I'm trying to send an image to zoom activity from my main_activity.
I have a onclick function:
case R.id.imageViewHero:
String image = ViewHolder.this.post.getImageUrl();
Intent intentv = new Intent(context, Zoom.class);
Bundle extras = new Bundle();
extras.putParcelable("imagebitmap", image);
intentv.putExtras(extras);
context.startActivity(intentv);
break;
the problem is the string image, I don't know what to do next to send it to zoom. Any ideas?
my zoom.class if needed:
public class Zoom extends Activity {
@SuppressLint("NewApi")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_zoom);
Bundle extras = getIntent().getExtras();
Bitmap bmp = (Bitmap) extras.getParcelable("imagebitmap");
ImageView imgDisplay;
Button btnClose;
imgDisplay = (ImageView) findViewById(R.id.imgDisplay);
btnClose = (Button) findViewById(R.id.btnClose);
btnClose.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Zoom.this.finish();
}
});
imgDisplay.setImageBitmap(bmp );
}
}