Win a copy of hapi.js in Action this week in the HTML, CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Display issue with android.R.layout.simple_list_item_1

 
Ritu varada
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am currently reading Head First Android Development. In chapter 6, its shown how to display a list using android.R.layout.simple_list_item_1.
When I test run the StarBuzz app, instead of showing the list, it shows the object name(com.hfad.starbuzz.Drink@3fsfsf). I ran using a Android phone(Android V4.2) and the emulator.
Same result. What could I be missing?


 
Tim Moores
Bartender
Posts: 3199
54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like the elements of "Drink.drinks" do not have an appropriate toString() method.
 
Ritu varada
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That fixed it. That's a basic Java 101 concept that I forgot. Thanks for your help!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!