I'm trying to launch an android activity from my Main activity, but I get force stop.
The logcat
error is like this:
java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
But the activity that I try to launch already has a ListView
with the id "list".
Any advice is appreciated.
UPDATE: Still can't figure out what's wrong.
Here's my code:
activity_all_apps.xml
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="com.example.app.AllAppsActivity">
<ListView
android:id="@android:id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</RelativeLayout>
and
AllAppsActivity.java
public class AllAppsActivity extends ListActivity