> Hi,
>
> I have issues with displaying a ListActivity in a TabActivity. The
> super simple code below causes a crash. Any ideas what is going wrong
> here and how can I fix it?
>
> public class MyTabView extends TabActivity
> {
>   public void onCreate(Bundle savedInstanceState)
>   {
>     super.onCreate(savedInstanceState);
>
>     TabHost mTabHost = getTabHost();
>
>
> mTabHost.addTab(mTabHost.newTabSpec("my_tab").setIndicator("Contacts").setContent(new
> Intent(this, Contacts.class)));
>   }
> }
>
>
> public class Contacts extends ListActivity
> {
>   @Override
>   public void onCreate(Bundle savedInstanceState)
>   {
>     super.onCreate(savedInstanceState);
>
>       // Empty for the time being...
>   }
> }
>

Try eliminating the ListActivity and just putting a ListView as the
contents of the tab.

Or, post your stack trace, so we have some idea what the error is.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com
Android App Developer Books: http://commonsware.com/books.html


-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to