Hey Mark! I have your book, it's a good book for android beginner like me..
 when is version 1.9 going to come out?
Anyway, I remove the two setup call and follow your example, and now it's
getting java.lang.NullPointerException null  as soon as it reach

final TabHost tabs = (TabHost) findViewById(R.id.tabhost);

Here's part of my current code:

final TabHost host = (TabHost) findViewById(R.id.tabhost);

    host.addTab(host.newTabSpec("TabOne")
                    .setIndicator("TabOne")
                    .setContent(R.id.home_scroll));

         host.addTab(host.newTabSpec("TabTwo")
                    .setIndicator("TabTwo")
                    .setContent(new Intent(this, myList.class)));

2008/11/30 Mark Murphy <[EMAIL PROTECTED]>

>
> Lawrence Samantha wrote:
> > Hi all,
> > I've been trying to debug this problem all day long and can't seem to
> > find the breakthrough. I'm using tabhosts to create tabs on the main
> > screen, then I try to put list inside the other tab.To achieve that, I'm
> > using setContent(Intent e ) methods.. hoping that the list will be
> > contained on the tab.
> > Here's my errorr I'm getting: Did you forget to call 'public void
> > setup(LocalActivityManager activityGroup)'?
> > But as you see on the codes below, I already call tabs.setup();
>
> Ah, but perhaps you shouldn't.
>
> First, AFAIK, TabActivity handles setup() for you.
>
> Second, you called setup(), not setup(LocalActivityManager
> activityGroup). My guess is that setup() wiped out the, er, setup that
> TabActivity did. Since you need the activityGroup to handle Intent-based
> tabs, your setup() call may be causing more harm than good.
>
> For example, from the soon-to-be-released Version 1.9 of (*cough*) my
> book, here's a TabActivity:
>
> public class IntentTabDemo extends TabActivity {
>        @Override
>        public void onCreate(Bundle savedInstanceState) {
>                super.onCreate(savedInstanceState);
>
>                TabHost host=getTabHost();
>
>                host.addTab(host.newTabSpec("one")
>                                .setIndicator("CW")
>                                .setContent(new Intent(this,
> CWBrowser.class)));
>                host.addTab(host.newTabSpec("two")
>                                .setIndicator("Android")
>                                .setContent(new Intent(this,
> AndroidBrowser.class)));
>
>                host.setCurrentTab(1);
>        }
> }
>
> (the host.setCurrentTab(1); line won't be in the book as I don't need
> it, but I put it in there to confirm that it does indeed work)
>
> Try commenting out your setup() call and see if things work.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com
> _The Busy Coder's Guide to Android Development_ Version 1.4 Published!
>
> >
>


-- 
Lawrence Samantha

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to