[android-developers] working with tabs (tabhost)

2011-10-08 Thread Kristoffer
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


Re: [android-developers] working with tabs (tabhost)

2011-10-08 Thread Subin Sebastian
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.drawable.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 Sebastian
http://in.linkedin.com/in/subinsebastien
https://plus.google.com/subinhttps://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