This is an example of using Activities in a TabActivity:

package com.eyebrowsoftware.gobeering.activities;

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

import com.eyebrowsoftware.gobeering.Beers;
import com.eyebrowsoftware.gobeering.Breweries;
import com.eyebrowsoftware.gobeering.R;
import com.eyebrowsoftware.gobeering.Venues;

public class GoBeering extends TabActivity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        TabHost mTabHost = getTabHost();

 
mTabHost.addTab(mTabHost.newTabSpec("tab_journal").setIndicator(this.getString(R.string.journal)).setContent(new
Intent(this, Journal.class)));
        Intent beers_intent = new Intent(Intent.ACTION_VIEW,
MyProvider.BEERS_CONTENT_URI);
 
mTabHost.addTab(mTabHost.newTabSpec("tab_beers").setIndicator(this.getString(R.string.beers)).setContent(beers_intent));
        Intent brewers_intent = new Intent(Intent.ACTION_VIEW,
MyProvider.BREWERIES_CONTENT_URI);
 
mTabHost.addTab(mTabHost.newTabSpec("tab_breweries").setIndicator(this.getString(R.string.breweries)).setContent(brewers_intent));
        Intent venues_intent = new Intent(Intent.ACTION_VIEW,
MyProvider.VENUES_CONTENT_URI);
 
mTabHost.addTab(mTabHost.newTabSpec("tab_venues").setIndicator(this.getString(R.string.venues)).setContent(venues_intent));

        mTabHost.setCurrentTab(0);
    }
}



On Mar 22, 5:38 am, "Nandan ." <[email protected]> wrote:
> hi Mark Have you solved ur problem to start a new activity within a tab
> activity.
>  how can u do this.
> can u shere with me
> thank you
> On Tue, Feb 2, 2010 at 10:58 PM, Mark Murphy <[email protected]>wrote:
>
>
>
>
>
> > > And the Problem is If i want to start activity which is not specified
> > > in tabhost in above Java code,it is going out of tabactivity.
> > > ie.,It is not coming in tabactivity.
>
> > > 2)But i want to have all the activities under tabActivity.
>
> > That is not possible, AFAIK.
>
> > --
> > 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]<android-developers%2Bunsubs 
> > [email protected]>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en
>
> --
> B!-!/-\\/!=$!-!

-- 
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

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to