Questions tagged [android-tabhost]

Display a sub list of tab labels representing each page in the parent's tab collection.

Displays a list of tab labels representing each page in the parent's tab collection. The container object for this widget is TabHost. When the user selects a tab, this object sends a message to the parent container, TabHost, to tell it to switch the displayed page. You typically won't use many methods directly on this object. The container TabHost is used to add labels, add the callback handler, and manage callbacks.

Reference: Android Developers Tabhost

2140 questions
276
votes
5 answers

How to return a result (startActivityForResult) from a TabHost Activity?

I have 3 classes in my example: Class A, the main activity. Class A calls a startActivityForResult: Intent intent = new Intent(this, ClassB.class); startActivityForResult(intent, "STRING"); Class B, this class is a TabActivity: Intent intent = new…
Cameron McBride
  • 6,650
  • 10
  • 37
  • 52
83
votes
5 answers

Is there any way to change android:windowSoftInputMode value from java class?

I want to act my tabs to have different windowSoftInputMode properties for each tab. How to access this property from java class when all handling of your tab is done from one single activity? Is there any way to access this manifest property from…
Prasham
  • 6,521
  • 8
  • 35
  • 54
70
votes
5 answers

Remove old Fragment from fragment manager

I'm trying to learn how to use Fragments in android. I'm trying to remove old fragment when new fragment is calling in android.
khouloud mejdoub
  • 876
  • 1
  • 7
  • 13
42
votes
5 answers

Updating Android Tab Icons

I have an activity that has a TabHost containing a set of TabSpecs each with a listview containing the items to be displayed by the tab. When each TabSpec is created, I set an icon to be displayed in the tab header. The TabSpecs are created in this…
lnediger
  • 1,280
  • 2
  • 12
  • 14
42
votes
4 answers

Android: TabHost without TabActivity

I want to create tabs without extending TabActivity. (The reason is that TabActivity cannot handle a custom titlebar as it seems). I have public class startTab extends Activity { @Override public void onCreate(Bundle savedInstanceState) { …
paradroid666
  • 553
  • 2
  • 6
  • 8
41
votes
1 answer

Dynamically changing the fragments inside a fragment tab host?

I have one main activity which is fragment activity here I am setting two tabs with two fragments A and B in the B fragment I have one button when the user click on the button I want to change fragment B to fragment C. But the tabs above are…
39
votes
9 answers

Android TabWidget detect click on current tab

I am trying to find way to be able to fire an onclick event on a tab when this tab is the current tab. I did try this way (among several other) with no success thou. public void onTabChanged(String tabId) { Log.d(this.getClass().getName(),…
0m4r
  • 1,025
  • 1
  • 14
  • 24
30
votes
2 answers

TabHost with Fragments and FragmentActivity

I'm working on an Android App and I want to use 3 tabs for navigation using Fragments for each tab, but I don't know how to create the structure for doing it. I want to add each fragment separately because each one is different, but I don't know…
29
votes
4 answers

Android - iphone style tabhost

Is it possible to style the Android Tabhost to look like that of the iPhone? If not, is there any open source code that can show how to create Bottom Tabs for Android ? (source: appshopper.com)
Soni Ali
  • 17,252
  • 15
  • 42
  • 49
27
votes
9 answers

How to change the Tabs Images in the TabHost

I am using the TabHost in my application, I am using four Tabs in my application and I want to use the different Images in the TabHost when the Particular Tab is been Selected and not selected. I need to use to different Images for a particular tab…
David Brown
  • 4,633
  • 17
  • 47
  • 72
26
votes
4 answers

How to change the font size of tabhost in android

How can the font size of the tabs be changed? I extend TabActivity for the tabs.
ReNa
  • 1,094
  • 6
  • 19
  • 36
26
votes
9 answers

Where can I find Android Tab Icons

Does anybody know of a website where I can find Android TabHost icons? (free or paid)
Tawani
  • 10,649
  • 20
  • 77
  • 104
25
votes
6 answers

How to switch tabs programmatically in Android from fragment?

I have implemented a TabActivity which extends FragmentActivity. It has 5 tabs each tab is a Fragment. What i am looking for is to switch between the tabs programmatically. For eg: if i am in tab4. On button click I want to move from tab4 to tab1.…
vinothp
  • 9,364
  • 17
  • 57
  • 102
22
votes
2 answers

Android using viewPager vs using tabhost

In my Android application I have had to use a tab layout and I want to choose a one from folowing scenarios. they are using viewPager using tab host what are the advantages of viewPager over tabhost. Which one is better. And I'm targeting the…
Vijitha
  • 295
  • 4
  • 7
21
votes
4 answers

How to programmatically switch tabs using buttonclick in Android

I have been struggling with this for a few days now. I'm trying to switch tabs programmatically upon a button click. My program works flawlessly if I just use the tabs to change activities, but wiring an onClick method with setCurrentTab results…
user552797
  • 219
  • 1
  • 2
  • 3
1
2 3
99 100