ActionBar not splitting after show - android

I hide the action bar first using below
getSupportActionBar().hide();
where for this activity i have android:uiOptions="splitActionBarWhenNarrow" but later before the page loads i show the action bar by below
getSupportActionBar().show();
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setLogo(R.drawable.ic_home);
but the problem is the action bar is not splitting after i hide and then show it.

Related

How to hide a certain activity's action bar while maintaining the navigation bar?

I'm developing an application with a side navigation menu.
In my activities, the action bar of the activity I'm loading overlays the action bar with the side navigation menu. Even though the side menu is there and works fine.
Home page with the side navigation:
Side navigation works when swiping:
I want to hide or remove the activity's action bar while maintaining the side navigation menu.
This is the code from the onCreate() method
FrameLayout contentFrameLayout = (FrameLayout) findViewById(R.id.content_frame);
getLayoutInflater().inflate(R.layout.activity_complaint, contentFrameLayout);
you can do 2 things
you can provide padding to the side navigation menu , so that the side navigation menu will be displayed just below the action bar
another thing you can do is to hide the Action bar when Navigation Drawer icon is clicked
the code to hide Action bar is below
android.support.v7.app.ActionBar AB= getSupportActionBar();
AB.hide();
I found a solution using the answer from this question:
How to Display Navigation Drawer in all activities?
and adding this bit of code to my activity in the Manifest.xml file
android:theme="#style/AppTheme.NoActionBar"

Hide Status Bar but display action bar

Status bar is where battery,time is displayed and action bar is title bar.I want to hide status bar in my app but display action bar.Is it possible?
Write the following in Activity after onCreate:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
Here is screenshot:

how to hide action bar in swipe view with tabs

Here's a link
I want to hide the action bar (application title bar)/full screen activity of application how can i do that??
You can hide the action bar by adding <android:theme="#android:style/Theme.NoTitleBar"> to your manifest, or programmatically :
getActionBar().hide();
// with abs
getSupportActionBar().hide();
This link may be helpfull

Show action bar after hiding it

I was developing an app for Android 2.3 where the menu sat nicely at the low right together with the back and home buttons.
I've been using
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"
to fully utilize the screen area.
Now, i'm adapting it to SDK>10, and here the menu sits at the top right in the action bar.
Using the above code line hides the action bar, which means I can't see the menu any more.
I could hide the action bar of course by using
ActionBar actionBar = getActionBar();
actionBar.hide();
Where should I put my
ActionBar actionBar = getActionBar();
actionBar.show();
if I'd like to show the action bar by touching the edges of the screen, just like how the software buttons show up?
Regards
/M

Hide Action Bar while showing Split Action Bar

How can I hide the top Action Bar but show the Split Action Bar using ActionBarSherlock. I would like to have Tabs at the top instead like this:
The Android developer site states the following to hide the action bar but keep the split action bar:
If you'd like to hide the main action bar at the top, because you're
using the built-in navigation tabs along with the split action bar,
call setDisplayShowHomeEnabled(false) to disable the application icon
in the action bar. In this case, there's now nothing left in the main
action bar, so it disappears and all that’s left are the navigation
tabs at the top and the action items at the bottom, as shown by the
second device in figure 3.
https://developer.android.com/guide/practices/tablets-and-handsets.html#SplitActionBar
In my SherlockFragmentActivity I call the following, however only the app icon and title disappear and the action bar stays like this:
//Hide action bar
getSupportActionBar().setDisplayShowTitleEnabled(false);
getSupportActionBar().setDisplayShowHomeEnabled(false);
Calling getSupportActionBar().hide() hides the action bar but also hides the split action bar.
The tabs only roll up into the top action bar if you are using the Tabs provided by ABS. You're not using ViewPager/ViewPagerIndicator for the tabs by any chance are you? (I have this issue currently)

Categories

Resources