John
John

Reputation: 11429

How to hide the status bar in some of the activities inside a tab activity on Android

I have an application with three tabs. I am using android:theme="@android:style/Theme.NoTitleBar.Fullscreen" to hide the status bar. It works when I put it inside my TabActivty in the manifest. This will hide the status bar in all of the three activities (inside the TabActivity). I want to hide the status bar for two of the three activities, not all of them. When I try to use the android:theme="@android:style/Theme.NoTitleBar.Fullscreen" for each Activity in the manifest, it won't hide the status bar.
How can I hide the status bar for just some of the activites inside the TabActivity?

Upvotes: 0

Views: 1062

Answers (4)

Nativ
Nativ

Reputation: 3150

You should do the following trick

<activity android:name=".Login" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />

Upvotes: 0

Phil H
Phil H

Reputation: 897

In your code you can call getActionBar().hide() or getSupportActionBar().hide(). This should allow you to show and hide the action bar as required. If you are trying to do this inside the fragments the you may need to get a reference the FragmentActivity.

Upvotes: 0

Chirag
Chirag

Reputation: 56925

Try with this code in each activity want to hide status bar.

   public void onResume()
   {
     handler.postDelayed(new Runnable() {
        public void run() {
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                             WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
    }, 1500);  
   }

Upvotes: 2

Rahmathullah M
Rahmathullah M

Reputation: 2716

You have set Theme for your activity in android manifest as follows...

<activity android:name=".Login" android:theme="@android:style/Theme.NoTitleBar" />

Please verify your activity tag after editing it.

Upvotes: 0

Related Questions