Hello.

Thanks for the reply, but iam not sure how i should implement that in
my code, here is my code that build the tabs.

TabHost tabHost = getTabHost();
TabHost.TabSpec spec;
Intent intent;

intent = new Intent().setClass(this, Main.class);
spec = tabHost.newTabSpec("main").setIndicator("Main")
.setContent(intent);
tabHost.addTab(spec);

intent = new Intent().setClass(this, Setting.class);
spec = tabHost.newTabSpec("settings").setIndicator("Settings")
.setContent(intent);
tabHost.addTab(spec);

tabHost.setCurrentTab(0);


And i also have this to work with:

int verified = pref.getInt("verified", 0);

        if (verified == 1) {
                 Then i need to change tab 1 to Main1.class instead of
Main.class
                 }



On 9 Okt, 06:22, Subin Sebastian <subinsebast...@gmail.com> wrote:
> Hi Kristoffer,
> As I understand from your question, I think you need to set a
> different content for the "main" tab when you change a specific
> preference in the "settings" tab. If I'm not wrong the below tutorial
> will help you to do so.
>
> http://subinsebastien.tumblr.com/post/6783812456/android-tab-layout
>
> In the above code, instead of passing a new TabSpec, create one
> reusable tabspec like,
> TabHost.TabSpec spec =
> mTabHst.newTabSpec("tab_test1").setIndicator("One",res.getDrawable(R.drawab­le.one)).setContent(i);
>
> In your method which is triggered on change of specific preference,
> use the following code.
>
> spec = spec.setContent(your_new_activity);
>
> I think this code should work, but I did not tested it yet. Please let
> me know if anything goes wrong.
>
> Thanks
>
> On 10/9/11, Kristoffer <kris.isak.v...@gmail.com> wrote:
>
>
>
>
>
> > Hello.
>
> > Iam not sure this is possible to do but here is what i need to do.
>
> > Iam now creating two tabs one for the "main" page and one for the
> > "settings".
> > Lets call them main.java and setting.java
>
> > When i change a "thing" on the setting.java page then i need to show a
> > different intent (main1.java) when the user push the "main" tab.
>
> > Is this possible in some way?
>
> > --
> > 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
>
> --
> Subin 
> Sebastianhttp://in.linkedin.com/in/subinsebastienhttps://plus.google.com/subin<https://plus.google.com/118262481642737404812>

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

Reply via email to