Hello, I need to transport the contents of an ImageView from one class to another, I tried Intent, but I could not get it. I have a Drawable that was edited in ImageView from the first class and I want to move this already edited content to another ImageView from another class.
I tried this way as shown below but did not work ..
In first class:
public void next(View v){
//resultView é uma ImageView
Bitmap p = drawableToBitmap(resultView.getDrawable());
Bundle param = new Bundle();
param.putParcelable("BITMAP", p);
Intent intent = new Intent(this, EditImage.class);
intent.putExtras(param);
startActivity(intent);
}
In second class:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (savedInstanceState == null) {
setContentView(R.layout.activity_main);
Intent intent = getIntent();
Bundle param = intent.getExtras();
Bitmap bit = param.getParcelable("BITMAP");
resultView.setImageBitmap(bit);
...
}
From now on I thank you for the help and attention, in case anyone has any ideas or tips on how to do it please inform, all help is valid. Hugs!