android: listActivity under Tab <p>Sorry if this is a repeat, none of the solutions I found online worked for me.</p> <p>I have 2 tabs, and I'm trying to add a list unto one of the tabs. Here's the code:</p> <pre><code>public class Library extends ListActivity { ParsingDBHelper mDbHelper; ListView lv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Bundle extra = getIntent().getExtras(); String temp = extra.getString(Httpdwld.RESULT); mDbHelper = new ParsingDBHelper(this); mDbHelper.open(); parsing(); fillData(); } private void parsing() { // IMPLEMENT } private void fillData() { Cursor c = mDbHelper.fetchAllSearch(); String[] FROM = new String[] {ParsingDBHelper.KEY_TITLE, ParsingDBHelper.KEY_AUTHOR, ParsingDBHelper.KEY_YEAR, ParsingDBHelper.KEY_LOCATION, ParsingDBHelper.KEY_CALL_ISBN, ParsingDBHelper.KEY_AVAILABILITY}; int[] TO = new int[] {R.id.row_title, R.id.row_author, R.id.row_year, R.id.row_location, R.id.row_id, R.id.row_avail}; SimpleCursorAdapter notes = new SimpleCursorAdapter(this, R.layout.row_layout, c, FROM, TO); lv.setAdapter(notes); } } </code></pre> <p>mDbHelper is simply a a helper for using SQLiteDatabase.</p> <p>Here's my XML code for the Tabs</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp"&gt; &lt;TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="5dp" &gt; &lt;/FrameLayout&gt; &lt;ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" /&gt; &lt;/LinearLayout&gt;&gt; &lt;/TabHost&gt; </code></pre> <p>But I keep getting "Cannot start Activity: Library" error. Here's where I call Library</p> <pre><code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.search_result); TabHost tabHost = getTabHost(); TabHost.TabSpec spec; Intent intent; intent = new Intent(this, Library.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("Library").setIndicator("Library") .setContent(intent); tabHost.addTab(spec); </code></pre> <p>}</p> <p>Any suggestions?</p>