照片捕获意图仅在Samsung手机上导致NullPointerException.
下面的实现.
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); } }