I want to show image after capture by click button Capture in the FirstActivity and show image in the activity_second(layout) using SecondActivity.
FirstActivity
use startActivityForResult() instead of startActivity()
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
Bitmap thumbnail = null;
if (requestCode == CAMERA_PIC_REQUEST) {
if (resultCode == RESULT_OK) {
thumbnail = (Bitmap) data.getExtras().get("data");
Intent i = new Intent(this, NextActivity.class);
i.putExtra("name", thumbnail);
startActivity(i);
}
}
}
Next in the next activity try to use this
protected void onCreate(Bundle savedInstanceState) {
//TODO Auto-generated method stub
super.onCreate(savedInstanceState);
//intialize the image view
Bitmap bitmap = getIntent().getExtras().getParcelable("name");
//set the image here.
}
Hope this may help you