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

Switch between tabs via swipe in android

I was create android application with tab and TabHost but users cant switch between tabs via swipe. I use TabActivity for this app. Users most click on tabs for switch between tabs or activities. MainActivity.Java : public class MainActivity extends…
Erfun
  • 1,079
  • 2
  • 11
  • 26
0
votes
1 answer

android change FragmentTabHost background and text color

i'm working FragmentTabHost.i created FragmentTabHost and i can replace some fragments.now i want to change background color in FragmentTabHost and also text color.for example i want background color black and text color white.this is a my xml…
0
votes
1 answer

set tab color, divider and text alignment in android

How to set text alignment and divider color in an tabhost widget. mTabHost = (FragmentTabHost) findViewById(android.R.id.tabhost); mTabHost.setup(this, getSupportFragmentManager(), R.id.realtabcontent); Bundle b = new Bundle(); …
yuva ツ
  • 3,707
  • 9
  • 50
  • 78
0
votes
1 answer

Use same xml layout file for TabHost

I have a tab host and I want to use the same layout file for all three tabs. But when I try to do this I only see the layout on one of the tabs not all three. myTabHost =(TabHost) findViewById(R.id.TabHost01); myTabHost.setup(); …
user3692917
0
votes
2 answers

ListView GetView is not Called

I have setup a list view I get some data from the web and then call my method handleData to use the data and put it in my list view but even though I have retrieved data and handleData is called I getView is not called. Here is my code I have put I…
iqueqiorio
  • 1,149
  • 2
  • 35
  • 78
0
votes
0 answers

FragmentTabHost with fragment switch

I am confused with FragmentTabHost to do fragment replacement. I have a few pages that have some views to click and then forward to another fragment, but after I replace that fragment and then click on other tabs, the fragments overlap…
Simon
  • 481
  • 2
  • 9
  • 20
0
votes
0 answers

How to declare a Numberpicker inside a Tabhost inside a Dialog?

I want to use a NumberPicker inside a Tabhostwhich is accessible through a Dialog. But How to define the NumberPicker? At the moment I'm doing this: NumberPicker np = (NumberPicker) d.findViewById(R.id.numberPicker); But this is not working. I get…
Megaetron
  • 1,154
  • 2
  • 15
  • 29
0
votes
1 answer

NullPointerException using TabHost in Dialog? How to do it right?

I'm trying to use a Tabhostin a Dialog so that the user can toggle inside the Dialog between to layouts. But I always get a NullPointerException. Any advice? or How to do it right? Dialog Method: public void dialog(){ final Dialog d = new…
Megaetron
  • 1,154
  • 2
  • 15
  • 29
0
votes
2 answers

Android FragmentTabHost how to get a reference to fragment in tab

I have a Fragment which implements FragmentTabHost and creates a couple of tabs each of which has a Fragment. I am trying to get a reference to one of these Fragments, but am drawing a blank as to how. public class TabFragment extends Fragment { …
QuantumTiger
  • 970
  • 1
  • 10
  • 22
0
votes
1 answer

Android - How can I pass myFragment.class as a parameter to a function

I'm creating a Tab Fragment with custom Tab controls as follows View tabView = createTabView(getActivity(),"Tab 1"); mTabHost.addTab(mTabHost.newTabSpec("tab1").setIndicator(tabView), Tab1Fragment.class, null); But rather than have…
QuantumTiger
  • 970
  • 1
  • 10
  • 22
0
votes
1 answer

tabhost implement sliding effects

I tried to use this solution: How to implement TabHost sliding effect? but doesnt do anything, i mean that everything remain the same. the implementation i think is very simple: i include here the code solution: import android.view.View; import…
Giovanni Far
  • 1,623
  • 6
  • 23
  • 37
0
votes
0 answers

Navigation Drawer with TabHost

I want to implement navigation drawer in my application in which instead of list view a tab host will be shown when user clicks on app icon. below is my code -
unflagged.destination
  • 1,576
  • 3
  • 19
  • 38
0
votes
1 answer

Dynamic remove Tab from TabHost problem on android1.5

My codes like this: public void removeTabForLogout(){ if (tabHost.getTabWidget().getChildCount()==4){ tabHost.setCurrentTab(0); tabHost.clearAllTabs(); tabHost.addTab(getTab1()); tabHost.addTab(getTab2()); } }…
hkbarton
  • 1
  • 1
  • 4
0
votes
1 answer

Android tabwidget selected tab with border line at bottom

i have a tabhost with the layout below. https://drive.google.com/file/d/0B8nQOFcSOOboNkRFV091VVhzanc/view?usp=sharing (sorry im unable to post photo as im a new user) I need to have the light blue color border for the selected tab. How i can have my…
0
votes
1 answer

Tabhost in fragment is throwing - you must specify a way to create the tab indicator exception

I'm trying to add a tabhost in my fragment that will hold 2 child fragments. I need to add arguments to them, but seems I cannot do this because I get this in my logCat: java.lang.IllegalArgumentException: you must specify a way to create the tab…
Darko Petkovski
  • 3,892
  • 13
  • 53
  • 117
1 2 3
99
100