I’m new to android programming.
I get the error on extending my Activity from ListActivity on the line
setContentView(R.layout.main);
Using the Log.e() in a try/catch the LogCat says:
12-25 05:58:36.959: E/ERROR(657): ERROR IN CODE: android.view.InflateException: Binary XML file line #6: Error inflating class Listview
My main.xml is as follows :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical">
<Listview
android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView
android:id="@id/android:empty"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="asd"/>
</RelativeLayout>
Code of the activity:
import android.app.ListActivity;
import android.os.Bundle;
import android.util.Log;
public class StatusListActivity extends ListActivity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
try {
setContentView(R.layout.main);
} catch(Exception e) {
Log.e("ERROR",e.toString());
}
}
}
Your code and error message shows Listview with a small ‘v’. Should be ListView with a capital ‘V’.