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
15
votes
1 answer

android: using ActivityGroup to embed activities

Im in the conceptualizing/design phase of building an app and i've hit a bit of a snag. Essentially i was looking for a way to embed one activity into the UI of another similar to how a TabHost/TabActivity. There would be a window at the top of the…
mtmurdock
  • 12,756
  • 21
  • 65
  • 108
15
votes
1 answer

FragmentTabHost - Tabs not addressable until viewed for the first time

I'm using a FragmentTabHost with multiple tabs (constructed as shown here). However, I cannot randomly address my tabs with getFragmentByTag (which returns in that case null) unless the addressed Tab has been activated by clicking on the tab at…
Dawodo
  • 433
  • 4
  • 15
14
votes
1 answer

Vertical tabs in Android

I want to make vertical tabs in Android like below image. I had see example for vertical tabs from below link. Click here In this link answer has some comments and in comments they had share code but the link of mega-upload is expired. I had try…
Dharmendra
  • 33,296
  • 22
  • 86
  • 129
14
votes
4 answers

iPhone- like tab bar in Android?

In iPhone we can create a view that has a tab bar and make it the root view of the application then use the tab bar to navigate through sub views. what is the most close approach to this in Android? Is it to use a Tabbed Control? but this includes…
Mina Wissa
  • 10,923
  • 13
  • 90
  • 158
14
votes
4 answers

Tab content disappeared after change page

I have a weird issue with my Tab (TabHost or TabContent) in my Fragment that contains a ViewPager. The problem is that when I change the page, then I turn back to the fragment with tab and viewPager, my content or view disappeared. -> Here's my…
sedayux
  • 1,242
  • 1
  • 11
  • 14
13
votes
2 answers

Badge on Android TabHost

I want to implement the functionality same as was there in iPhone I implemented the custom Tabhost same as in iPhone in the bottom bar. I can set two Icons for Normal/Selected state but I need the dynamic icon with number of notifications as given…
13
votes
3 answers

InputMethodManager holds reference to the tabhost - Memory Leak - OOM Error

View hierarchy is as follows TabActivity -> ActivityGroups -> Activities. Using MAT I found that TabWidget is referenced by TabHost which is referenced by InputMethodManager, hence TabWidget is leaked. On Subsequent launch of application OutOfMemory…
Mani
  • 2,599
  • 4
  • 30
  • 49
13
votes
5 answers

Nested tabs with viewpager swiping in android?

I've implemented nested tabs with view pager with no problems, but my problem is on the swiping part, When I do the swiping action the main activity tabs will be switched, but I want the fragment to swipe instead. how can I achieve this? I've tried…
13
votes
2 answers

EditText and TabHost do not like each other

I have a layout with EditText and TabHost containing 2 tabs. Android 1.6. I use hardware keyboard in following case. Steps to reproduce: When activity is displayed the EditText gains focus. As soon as I press any key the EditText loses focus and…
plugmind
  • 7,926
  • 4
  • 34
  • 39
13
votes
3 answers

Modify tab indicator dynamically in Android

My application needs to update tab indicator dynamically, I'm trying to do this by invoke TabSpec.setIndicator(), but it doesn't work. Here is my code: In onCreate method of TabActivity: tabHost = getTabHost(); TabSpec tabSpec =…
ZelluX
  • 69,107
  • 19
  • 71
  • 104
12
votes
4 answers

Android TabHost.addTab -> Null pointer exception

Here is my code: public class Main extends Activity { @Override public void onCreate(Bundle savedInstanceState) { TabHost tabHost = new TabHost(this); TabHost.TabSpec tab = tabHost.newTabSpec("tab1"); …
Joel
  • 3,427
  • 5
  • 38
  • 60
12
votes
1 answer

Custom tabs in android

I'm having a really hard time understanding how to use custom tabs in android. I don't want to just be able to set the text and stuff. How can I change the size, and the image, and all that. I've googled and I can't find anything that makes sense
Falmarri
  • 47,727
  • 41
  • 151
  • 191
12
votes
3 answers

How to set Android toolbar height?

I want to achieve this: What I thought was to make a Custom Toolbar with a bigger height and work with the tabhost and tabpager normally. I have implemented it, but the toolbar is showing the normal height, so it doesn't show as I want, just the…
11
votes
3 answers

How to call tab Onclick and OnTabChange for same tab

In my project, I have two tabs and a button. For two tabs,I have two activities and button calling different activity. the thing is I am showing result of button on first tab. i.e tab0 is active on tab0Event and on button click event too. And am…
Romi
  • 4,833
  • 28
  • 81
  • 113
11
votes
5 answers

Can I use default tab styling in my custom tab view?

My main activity is a TabActivity, but my tabs don't require icons. I know I can omit the icon by using the overloaded TabHost.TabSpec.setIndicator(CharSequence label) method, as answered in this question. But the space where the icon would go is…
mhelvens
  • 4,225
  • 4
  • 31
  • 55