Questions tagged [fragment-tab-host]

Special TabHost that allows the use of Fragment objects for its tab content. When placing this in a view hierarchy, after inflating the hierarchy you must call setup(Context, FragmentManager, int) to complete the initialization of the tab host.

296 questions
86
votes
13 answers

IllegalStateException: Fragment already added in the tabhost fragment

FATAL EXCEPTION: main Process: com.example.loan, PID: 24169 java.lang.IllegalStateException: Fragment already added: FormFragment{428f10c8 #1 id=0x7f050055 form} at…
user782104
  • 12,011
  • 51
  • 154
  • 289
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…
21
votes
3 answers

Is it possible to manually call onCreateView in a Fragment?

Is it possible to manually call the method onCreateView in a Fragment or, if not, is there some way I can simulate this invocation? I have a FragmentActivity with tabHost. Each tab contains a Fragment and I want to refresh the Fragment's view when I…
Symon_9851
  • 345
  • 1
  • 3
  • 9
19
votes
3 answers

FragmentTabHost not creating view inside Fragment in android

I am having an issue getting the view to change on a tabhost - when I select a tab the content stays blank. From what I can tell, onCreateView is not being called on the child Fragments. onMenuCreate runs fine because the menu changes like it is…
19
votes
1 answer

Tutorial to implement the use of TabHost in Android 2.2 + ViewPager and Fragments

A short tutorial for people like me who had some trouble finding a way to implement TabHost and ViewPager, including page swiping with fingers and tab click to change pages. The shown solution is compatible with Android versions 2.2+. It includes…
12
votes
4 answers

How to create an Android Tabbed Dialog containing fragments?

Can anyone point me to an example or show me how to create a simple Tabbed Dialog in Android where the contents of each tab are Fragments? All the examples/tutorials I have found are about Fragments and Tabs, but nothing specific to…
10
votes
1 answer

IllegalStateException on FragmentManager

My app keeps to report this issue on many Android platforms (4.1, 4.0.4, 2.3.6...). But I could not reproduce this issue on my phone. I have searched for this issue by Google, but the stack trace seems not the same as my. Does someone know how the…
9
votes
4 answers

Change text color and selector in TabWidget

I've a TabWidget, independently of the ÀctionBar, in aFragmentTabHost`. I want to customize the look and feel of the TabWidget but I don't get it. My intention is to change the text color and the selector color, as you can see in the image I can…
Mun0n
  • 4,410
  • 4
  • 24
  • 45
9
votes
4 answers

Fragmenttabhost performance is slow?

I have use the v4 support lib for FragmentTabHost The requirement is that when I am switching tab one to another & another one, that is calling onCreateView() & onActivityCreated() every time. That's why my code performance is slow. So, any other…
Saunik Singh
  • 988
  • 9
  • 19
7
votes
4 answers

How to maintain fragment's state in the application

How to maintain fragment's state when it is shown within FragmentTabHost? Thanks to this tutorial, I'm able to implement FragmentTabHost in my application. My intention is to create an app whose main activity contains some tabs (which sticks on the…
reiley
  • 3,333
  • 9
  • 48
  • 105
7
votes
2 answers

Replace one fragment to another fragment in the TabHost

I am creating a five tabs that contains one fragment each. I am using ListView in the first tab and in the ListView OnItemClickListener I want to replace from the first Tab Fragment to second tab Fragment. How can I do that by using Fragment and…
It's me
  • 905
  • 5
  • 13
  • 28
7
votes
2 answers

Tabbed dialog with fragments in widget

I am working on widget, where for widget settings i am looking to provide a dialog for with tab fragment, the problem is dialog do not have action bar tabs, i have tried various lay out patterns, but none of them seems to work. In the manifest,…
6
votes
2 answers

How to get current selected Fragment in FragmentTabHost

There are some questions related to this same issue. For example, this one. But it doesn't work. Let me show what I did in my code. activity_main.xml
Bagusflyer
  • 11,547
  • 16
  • 84
  • 167
6
votes
2 answers

Fragment tab host error:Exception raised during rendering: No tab known for tag null

I have been using the fragment tab host for some time and it was working fine. Suddenly i am getting this layout compilation error. Exception raised during rendering: No tab known for tag…
OnDWay
  • 109
  • 3
  • 11
6
votes
2 answers

Android : passing parameters to a tab

In my Android app, I use the following code to create tabs : mTabHost = (FragmentTabHost)findViewById(android.R.id.tabhost); mTabHost.setup(this, getSupportFragmentManager(),…
Arnaud
  • 6,339
  • 8
  • 47
  • 64
1
2 3
19 20