Posts

Showing posts with the label android-tabhost

Android TabHost appears in Front of Fragments

Image
Android TabHost appears in Front of Fragments I have not been able to find a solution to this issue on any other stack posts or Android documentation. For some reason in a FragmentActivity using the support.v4 library fragments appear behind the tabhost as demonstrated in this screenshot: MainActivity.java: public class MainActivity extends FragmentActivity { // Declare Variables private FragmentTabHost mTabHost; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Set the view from main_fragment.xml setContentView(R.layout.main_fragment); setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); //locks screen orientation to portrait // Locate android.R.id.tabhost in main_fragment.xml mTabHost = (FragmentTabHost) findViewById(android.R.id.tabhost); // Create the tabs in main_fragment.xml mTabHost.setup(this, getSupportFragmentManager(), R.id.t...