• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Adding image in AlertDialog

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 30
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
If you want to look young and thin, hang around old, fat people. Or this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic