File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes Adding image in AlertDialog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Adding image in AlertDialog" Watch "Adding image in AlertDialog" New topic
Author

Adding image in AlertDialog

Nehel Patel
Greenhorn

Joined: Feb 09, 2010
Posts: 21
Hi All,

I want to add image in Alertdialog other than setIcon... means with setIcon I am displaying one image, but with actual message I want to display one more image in dialog. How can I do this? Please help

Thanks & Regard,
Nehel
Shawn Franks
Greenhorn

Joined: May 18, 2010
Posts: 23
Nehel Patel wrote:Hi All,

I want to add image in Alertdialog other than setIcon... means with setIcon I am displaying one image, but with actual message I want to display one more image in dialog. How can I do this? Please help

Thanks & Regard,
Nehel


There are multiple ways of doing so.
1) you can edit the image to make both one image,
2) you can extend the dialog class,
3) you can dynamically add views to your alert dialog,

or the last and easiest option would be to create a custom dialog interface using xml, and use the android api for layout inflating.
CutsomDialog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Adding image in AlertDialog
 
Similar Threads
Get Image on a JLabel
How to change image on label without using seticon method
applet to change an image when keypressed
Adding Image to a button
How to display an Image with the Text in a JButton ??