Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to display image

 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I can't display image .It does not give me any error and image is also at proper location ?
 
Mark L. Murphy
Author
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two comments:

First, unless you work for Sun, don't make applications in the java.* namespace (e.g., java.android). Similarly, unless you are on the core Android team, don't make applications in the android.* namespace.

Second, you create a new ImageView object, but then you do nothing with it. If the layout specified by R.layout.preview has an ImageView in it, perhaps you want to call findViewById() to get that ImageView (after the call to setContentView()) and put your image on it.
 
chetan dhumane
Ranch Hand
Posts: 641
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your suggestion.

I will take care for namespaces in future.
Your suggestion helped me to solve my problem.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic