This week's book giveaway is in the Beginning Java forum.
We're giving away four copies of Getting started with Java programming language and have Ashish Sarin & J Sharma on-line!
See this thread for details.
Win a copy of Getting started with Java programming language this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

error : Your content must have a ListView  RSS feed

 
sm smemamian
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

Why am I getting this message?

06-20 18:47:11.839: E/AndroidRuntime(1065): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test/com.example.test.MainActivity}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'



MainActivity.java :


activity_main.xml :



row.xml :
 
Ameet Sagar
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when you are using ListActivity by extending the ListActivity class you should not use the setContentView() method.

Try commenting out the setContentView() method. It will work fine... enjoy...!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!