Проблема с ListView
.
Cтактрейс ошибки:
Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' at android.app.ListActivity.onContentChanged(ListActivity.java:243) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:318) at android.app.Activity.setContentView(Activity.java:1973) at ru.neohorus.trains.FUC.onCreate(FUC.java:15) at android.app.Activity.performCreate(Activity.java:5275) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2164) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2250) at android.app.ActivityThread.access$800(ActivityThread.java:139) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1200) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5105) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:792) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608) at dalvik.system.NativeStart.main(Native Method)
Активность FUC.class:
public class FUCK extends ListActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fuc);
ListView list1 = (ListView) findViewById(R.id.list11);
ArrayList<Contact> list = new ArrayList<Contact>();
list.add(new Contact("09", "47", "Фр", "Я", "кр"));
list.add(new Contact("14", "67", "Фр", "Ло", "кр"));
ListAdapter adapter = new SimpleAdapter(this, list, R.layout.group_view,
new String[] {Contact.TI, Contact.CO, Contact.NA, Contact.ST, Contact.HO}, new int[] {
R.id.tex, R.id.te, R.id.tr, R.id.st, R.id.ho});
list1.setAdapter(adapter);
}
}
Разметка fuc.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ListView android:layout_width="match_parent" android:layout_height="match_parent"
android:divider="@color/list_divider"
android:dividerHeight="3dp"
android:id="@+id/list11"
>
</ListView>
</LinearLayout>