• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error : Your content must have a ListView

 
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