Фотозапись Intent
вызывает NullPointerException
только на телефонах Samsung.
Реализация ниже.
final Button capture = (Button)findViewById(R.id.capture_button);
capture.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent cameraIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(cameraIntent, CAMERA_PIC_REQUEST);
}
});
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_PIC_REQUEST) {
Bitmap thumbnail = (Bitmap)data.getExtras().get("data");
ImageView image = (ImageView)findViewById(R.id.photoResultView);
image.setImageBitmap(thumbnail);
}
}