• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unable to display image  RSS feed

 
Ranch Hand
Posts: 643
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 ?
 
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: 643
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!