Hello,

I'm trying to use a TabActivity class to tab-ify my application.  I've
found some walkthroughs online but I think they are a little dated.

I want to use Activities inside the tab and just re-use the activities
I wrote in the current version.

It's telling me that there is no onCreate method so I'm hoping someone
can help me correct the code or give me a substitute.

Here is what my code looks like:

package [...]

import android.app.TabActivity;
import android.content.Intent;
import android.widget.TabHost;

public class MyCollection extends TabActivity {

          @Override
          public void onCreate(Bundle savedInstanceState) {
                 super.onCreate(savedInstanceState);
                 TabHost host=getTabHost();

                 host.addTab(host.newTabSpec("one")
                                 .setIndicator("Test1")
                                 .setContent(new Intent(this,
test.class)));
                 host.addTab(host.newTabSpec("two")
                     .setIndicator("Test2")
                     .setContent(new Intent(this, test.class)));
                 host.addTab(host.newTabSpec("three")
                                .setIndicator("Test3")
                                 .setContent(new Intent(this,
test.class)));
          }
}
--~--~---------~--~----~------------~-------~--~----~
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