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

2122 questions
6
votes
4 answers

Android - TabActivity with Transition animation

I'm trying to add an animation to my TabActivty. For example, when the user select the 2nd tab, I want the new activity comes from the right. When the user select the first tab, I want the activity comes from the left. I've found how to add one…
Manitoba
  • 8,522
  • 11
  • 60
  • 122
5
votes
4 answers

can anyone give sample code for TabHost in Android?

I need sample code to create TabHost in android. can anyone help me.
Rajapandian
  • 7,059
  • 11
  • 37
  • 27
5
votes
2 answers

MapActivity in TabHost Fragment disappearing after tab switch

I'm trying to display a map in a set of tabs, using fragments. The problem I'm having is the map activity disappears if the user navigates to another fragment, then back. How can I display a MapActivity in fragments in a tabhost? The basis for this…
5
votes
2 answers

Android Title bar leaving space in when application is resumed

I am using a Tab Host in my Android App. I have the Titlebar hidden. When I leave the App and resume to it, I have some strange behaviour. If I resume to a tab using a list activity with listView.setAdapter, the title bar is hidden and the space it…
user466607
5
votes
2 answers

Android TabView error?

I am trying to implement Tab View for my activity. I am getting an error that states. java.lang.IllegalArgumentException: you must specify a way to create the tab indicator Resources res = getResources(); // Resource object to get Drawables …
Vinoth
  • 1,339
  • 6
  • 23
  • 42
5
votes
2 answers

Fire action on other activity within TabHost? (Android)

I am currently in an Android project where our main view is a TabActivity and each tab is a separate Activity. One is a MapActivity and the other two are ordinary Activities. First note that I think we must have each tab as separate activities, as…
Emil
  • 91
  • 1
  • 6
5
votes
2 answers

Activity in tab host goes blank

I am having tab host with three tabs.In the first tab i am doing some bitmap operations on a canvas(bit heavy). Whenever i move on to second or third tab,the activity in the tab goes blank.I have a edit text in tab 1,so when ever the soft keyboard…
androidGuy
  • 5,553
  • 12
  • 39
  • 56
5
votes
1 answer

Saving a backstack across orientation change

I am trying out using fragments with my tabhost for the first time and I am pretty impressed. That said, one of my tabs uses two fragments, first the user sees Fragment A and then if they hit a button in Fragment A it gets swapped with fragment B,…
akhalsa
  • 2,303
  • 3
  • 25
  • 43
5
votes
1 answer

How to create custom api for tabhost and tabwidget?

I have created scrollable tab bar, using tabhost, tabwidget, and horizontalscrollbar which is layout_gravity is bottom. Now, i want to create custom API for that, so any one can use the api change the textsize, height, width etc..,according their…
5
votes
1 answer

Android - onTabChanged not being invoked upon selecting a different tab

Thanks for checking out my inquiry! I have implemented a tab environment as illustrated below. It seems to work as I expected except that it never executes the onTabChanged method. I have found several posts about this type of situation but have not…
Chip G
  • 118
  • 1
  • 9
5
votes
2 answers

Android: How to dynamically change inflated tab content?

I am having trouble setting the content on a tab that I've inflated from an XML file. I add the tab to my TabHost ('tabs') dynamically by doing the following: TabSpec passSpec = tabs.newTabSpec("Pass Tab"); …
TomBomb
  • 3,236
  • 5
  • 31
  • 40
5
votes
3 answers

Tab host - setCurrentTab(x) works for tab but not a content [Android]

I have created tab app.. now I am playing with screen rotation. I tried to set tabHost.getTabWidget().setCurrentTab(1), which should show second tab (first is 0). The point is that second tab is shown as selected, but shown content is from first…
M.V.
  • 1,662
  • 8
  • 32
  • 55
5
votes
4 answers

onResume() isn't triggering on TabHost items switching

I have a TabHost with two tabs in it. The first time I switch to the second tab the onResume() method of my second's tab's activity invoked. Then I have an AlertDialog shown and after it disappears the 'onResume()' method isn't called but I really…
Eugene
  • 59,186
  • 91
  • 226
  • 333
5
votes
3 answers

Why onResume is called when i open for the first time the tab of a tabhost?

I have a tabhost with some tabs, and each tab have implemented the method onresume, because I need to reload all the data from a remote database each time the user enter again in a tabhost, not only the first time he opens it. Ok, it works nice, but…
NullPointerException
  • 36,107
  • 79
  • 222
  • 382
5
votes
1 answer

Using TabWidget.setDividerDrawable()?

Has anyone had any success with TabWidget.setDivider()? I'm not sure it does what I'm assuming: gives you a chance to supply a drawable to be drawn between each tab…
user291701
  • 38,411
  • 72
  • 187
  • 285