I\'ve followed this tutorial but when I try to run the application I get Unfortunately HelloListView has stopped
The IDE gives no warnings or errors.
My Hel
You have to add setContentView(R.layout.yourlayout)
after the super.onCreate(savedInstanceState);
the R.layout.yourlayout
should look like this ( in folder res/layout ) :
<?xml version="1.0" encoding="utf-8"?>
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
When you extend ListActivity, you need to have an xml which contains id as @android:id/list
, then in your activity you need to setContentView(R.layout.yourxmlName)
; Here is tutorial.