[android-developers] Re: problem with TabHost

2009-10-29 Thread Kevin Bailey

On Wed, Oct 28, 2009 at 06:40:24PM -0700, tatman wrote:
 
 ?xml version=1.0 encoding=utf-8?
 TabHost
   xmlns:android=http://schemas.android.com/apk/res/android;
   android:id=@+id/tabhost

Don't know if it will help but my main.xml file says:

android:id=@android:id/tabhost

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



[android-developers] ListActivity in Tab crashes

2009-10-26 Thread Kevin Bailey

I'm trying to create an application that has 3 tabs.
Under the middle tab should be a ListView. It starts up
fine (on the left tab) but when I click the middle tab it crashes.

The other two tabs are static data specified in the
main.xml file. But the middle tab, I try to create
dynamically. Here's the code from the main onCreate function:

// this tab without a backing activity works fine
mTabHost.addTab(mTabHost.newTabSpec(tab_test1)
.setIndicator(Compose)
.setContent(R.id.compose_tab));

// this one never even reaches ContactListActivity::onCreate
Intent intent = new Intent(this, ContactListActivity.class);

mTabHost.addTab(mTabHost.newTabSpec(tab_test2)
.setIndicator(Contacts)
.setContent(intent));

Instead I appear to get an exception:

ActivityNotFoundException from
ViewRoot.handleMessage(Message) line 1583
ViewRoot(Handler).dispatchMessage(Message) line 99
Looper.loop() line 123
ActivityThread.main(String[]) line 3948
...

ContactListActivity is defined this way:

public class ContactListActivity extends ListActivity
{
...

I get the feeling that I'm supposed to create the Intent
with something like Intent.ACTION_VIEW but this is where
I get lost. If this is the problem, I could try stuff
until it works, but I'd prefer to understand why.

Or is ContactListActivity supposed to override something ?

Any help would be appreciated.

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