Still are having no luck at all, I have changed the camera intent code to:
@Override
public void onClick(View v) {
String _path = Environment.getExternalStorageDirectory().getAbsolutePath() + "sunpic.jpg";
File file = new File(_path);
//Uri fileUri = Uri.fromFile(file);
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, file);
//File file = new File(Environment.getExternalStorageDirectory().getPath());
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(file));
startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE);
}
});
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
//super.onActivityResult(requestCode, resultCode, data);
if(requestCode == CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE && resultCode == RESULT_OK) {
//Uri file = data.getData();
FileInputStream is;
try {
is = new FileInputStream("mnt/sdcard/sunpic.jpg");
Bitmap bmp = BitmapFactory.decodeStream(is);
//Bitmap bmp = android.provider.MediaStore.Images.Media.getBitmap(this.getContentResolver(), file);
//Bitmap bmp = (Bitmap) data.getExtras().get("data");
bmp.getPixels(pixels, 0, bmp.getWidth(), 0, 0, bmp.getWidth(), bmp.getHeight());
The rest of this is identical to what is in my original post.
The logcat is empty and as soon as I take a picture on the camera, it freezes.
What I tried earlier did not include
FileInputStream is;
try {
is = new FileInputStream("mnt/sdcard/sunpic.jpg");
and had the next line as
Bitmap bmp = BitmapFactory.decodeStream("sunpic.jpg");
But that consistently spat out NullPointer errors, to which I really do not understand why, despite reading many other threads/other web resources about it.