Monday, November 26, 2012

Convert Drawable to Bitmap and send it to Another Activity


In this post we convert our Drawable to Bitmap and pass that bitmap to another activity using Intent

For more update about android click below link
To convert your Drawable to Bitmap use following code snippet in android.R

Bitmap bitmap = ((BitmapDrawable)d).getBitmap();

For passing that bitmap to another activity using intent use this below code snippet.

intent.putExtra("Bitmap", bitmap);

And for fetch that bitmap intent in another activity use this

Bitmap bitmap = (Bitmap)this.getIntent().getParcelableExtra("Bitmap");

Click below link for more update about android

No comments:

Post a Comment