Intent problem Android
<p>I had a class that access the native camera to take picture. After the picture had been taken, it will be save in a folder and that picture will be display in a new activity.</p>

<p>The problem is, i try to the get the data i put into the intent after the picture had been taken but it always says that the intent is <code>null.pointer.exception</code>. Below is my class, anyone please help me.</p>

<pre><code>import java.io.File;
import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.provider.MediaStore;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

 public class CameraTestActivity extends Activity {
Button start;
final int TAKE_PICTURE = 2;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    start = (Button)findViewById(R.id.startButton);

    start.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View arg0) {
            // TODO Auto-generated method stub

            File file = new File(Environment.getExternalStorageDirectory().toString() + "/testImage/" + "toBeUpload.jpg");
            Uri imageUri = Uri.fromFile(file);


            Intent cameraIntent = new Intent("android.media.action.IMAGE_CAPTURE");
            cameraIntent.putExtra(MediaStore.EXTRA_OUTPUT, imageUri);
            cameraIntent.putExtra("path", imageUri.toString());
            startActivityForResult(cameraIntent,TAKE_PICTURE);

        }
    });
}

protected void onActivityResult(int requestCode, int resultCode, Intent intent)
{
    super.onActivityResult(requestCode, resultCode, intent);
    if(resultCode == RESULT_OK)
    {
        if(requestCode == TAKE_PICTURE)
        {
            /*ERRROR OCCUR HERE*/
            Bundle extras = intent.getExtras();
        }
    }
}
}
</code></pre>
