Skip to content

Instantly share code, notes, and snippets.

@jcarlos7121
Created November 22, 2012 21:42
Show Gist options
  • Select an option

  • Save jcarlos7121/4133031 to your computer and use it in GitHub Desktop.

Select an option

Save jcarlos7121/4133031 to your computer and use it in GitHub Desktop.
Convert drawable from bitmap on Android
Drawable d = new BitmapDrawable(getResources(),bitmap);
alertDialog.setTitle("Product Information");
alertDialog.setMessage(myProduct.getMyProductInfo());
alertDialog.setButton("Back", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
showPrompt();
}
});
alertDialog.setIcon(d);//<--Here Need to Provide a different image each time
alertDialog.show();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment