Win a copy of Murach's Java Programming 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...!!!
 
We're all out of roofs. But we still have tiny ads:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!