Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7985091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:28:19+00:00 2026-06-04T11:28:19+00:00

I am trying to have a tabhost that it contained in a fragment, where

  • 0

I am trying to have a tabhost that it contained in a fragment, where the tab content is defined by fragments. okay then,

I started from the FragmentsTab example from google. this shows how to use fragments as the tab content, but the TabHost itself is still hosted in an activity. again, i need the tab host to be hosted in a Fragment.

I took FragmentsTab example, and moved the the code in onCreate() and moved it to onCreateView() in my Fragment,

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View fragmentView = inflater.inflate(R.layout.detail_fragment, container);

    mTabHost = (TabHost) fragmentView.findViewById(android.R.id.tabhost);
    mTabHost.setup();

    mTabManager = new TabManager(getActivity(), mTabHost, R.id.realtabcontent);

    // TODO: localize
    mTabManager.addTab(mTabHost.newTabSpec("info").setIndicator("File Info"), InfoFragment.class, null);

    return fragmentView;
}

when i run, i get this exception,

05-25 14:42:27.272: E/AndroidRuntime(4701): Caused by: java.lang.IllegalStateException: Recursive entry to executePendingTransactions
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1343)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:429)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at com.zimbra.octopus.android.TabManager.onTabChanged(TabManager.java:116)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.widget.TabHost.invokeOnTabChangeListener(TabHost.java:359)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.widget.TabHost.setCurrentTab(TabHost.java:344)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.widget.TabHost.addTab(TabHost.java:216)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at com.zimbra.octopus.android.TabManager.addTab(TabManager.java:92)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at com.zimbra.octopus.android.DetailFragment.onCreateView(DetailFragment.java:46)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:819)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1053)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:622)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1371)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(FragmentManager.java:429)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at com.zimbra.octopus.android.TabManager.onTabChanged(TabManager.java:116)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.widget.TabHost.invokeOnTabChangeListener(TabHost.java:359)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.widget.TabHost.setCurrentTab(TabHost.java:344)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.widget.TabHost.addTab(TabHost.java:216)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at com.zimbra.octopus.android.TabManager.addTab(TabManager.java:92)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at com.zimbra.octopus.android.DetailFragment.onCreateView(DetailFragment.java:46)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:819)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1032)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1111)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:264)
05-25 14:42:27.272: E/AndroidRuntime(4701):     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)

looking at the trace, i see onCreateView() for DetailFragment (the fragment hosting the TabHost) call recursively. somehow, the call to TabManager.addTab() (again see the FragmentsTab example) is resulting in a recursive call to DetailFragment.onCreateView().

What am I doing wrong? Is this even possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:28:20+00:00Added an answer on June 4, 2026 at 11:28 am

    Android doesn’t allow you to embed one fragments inside other fragments. Your logcat indicates that you are executing one fragment transaction within another (i.e. recursive entry to executePendingTransactions). It’s just not allowed, sorry!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have trying to learn MVC4 Web API. I am running my project from
I am trying to have a method that takes in a username and will
So I'm trying to have a window that I can drag around by the
I am trying to have a content block always be shown to the user,
I'm trying to build something that I'm not sure if it's possible. I have
trying to have two class that reference each others, in the same file. What
I have trying to solve this problem from last few days but no success.
I have trying to get around making my first C# application(that can do more
I`m trying to build a application using the Fragment/Tabs and Pager from the android
I have a TabHost activity that are switching activities, so my main looks like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.