This is my image capture method
imageView = findViewById(R.id.image_prievew);
findViewById(R.id.btn_image_capture).setOnClickListener(v -> {
captureBitmap(bitmap -> {
new Handler().post(() -> {
String imagePath = getImageFilePath();
saveAsPngImage(bitmap, imagePath);
exportPngToGallery(getApplicationContext(), imagePath);
imageView.setImageBitmap((bitmap));
});
});
});
I used this method in my first activity just below of image capture method(Activity 1)
findViewById(R.id.image_prievew).setOnClickListener(new View.OnClickListener() {
@override
public void onClick(View v) {
Bitmap receipt = BitmapFactory.decodeFile(bitmap.toString());
Intent intent = new Intent(BaseCameraActivity.this,ImageCaptureListner.class);
intent.putExtra("Bmp",receipt); //Optional parameters
startActivity(intent);
}
});
I want to pass above captured image into this activity but it showing errorActivity 2)
imageView = (ImageView) findViewById(R.id.image_bitmap);
Bitmap bitmap = getIntent().getExtras().getParcelable("Bmp");
imageView.setImageBitmap(bitmap);