tags:

views:

34

answers:

1

Developing my first app for android. Works OK on emulator, but on phone I get a "Source not found error" ViewRoot.handleMessage(Message)line:1757. I get the error when I press button number 4 on the application and try to display my media images on phone

Code package com.example.famiily_connect_v1;

import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; import android.widget.TextView;

public class family_connect extends Activity implements OnClickListener { /** Called when the activity is first created. */

Button incrementButton, decrementButton, makecallButton,
        media_cameraButton;
TextView numberdisplayTextView;
EditText inputEditText;
int A = 0;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    incrementButton = (Button) findViewById(R.id.Button01);
    decrementButton = (Button) findViewById(R.id.Button02);
    makecallButton = (Button) findViewById(R.id.Button03);
    media_cameraButton = (Button) findViewById(R.id.Button04);
    numberdisplayTextView = (TextView) findViewById(R.id.TextView01);
    inputEditText = (EditText) findViewById(R.id.EditText01);

    incrementButton.setOnClickListener(this);
    decrementButton.setOnClickListener(this);
    makecallButton.setOnClickListener(this);
    media_cameraButton.setOnClickListener(this);
    numberdisplayTextView.setOnClickListener(this);
    inputEditText.setOnClickListener(this);

}

@Override
public void onClick(View arg0) {
    switch (arg0.getId()) {
    case R.id.Button01:
        A++;
        numberdisplayTextView.setText(String.valueOf(A));
        break;
    case R.id.Button02:
        A--;
        numberdisplayTextView.setText(String.valueOf(A));
        break;
    case R.id.Button03:

        break;
    case R.id.Button04:
        Intent myIntent = new Intent();
        myIntent.setAction(Intent.ACTION_VIEW); 
     myIntent.setData(android.provider.MediaStore.Images.Media.INTERNAL_CONTENT_URI);
        startActivity(myIntent);
        break;
    default:
        break;
    }

}

}

XML

A: 

Enable in your Eclipse the LogCat

Window > Show View > Other > Android > LogCat

then you can find what is the real description of your Exception.

Jorgesys