0

I am working on application were most of activity are in full screen. so i implemented it with using theme.

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <!-- Customize your theme here. --> <item name="windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="android:windowFullscreen">true</item> <item name="android:windowContentOverlay">@null</item> </style> 

now i stuck with the situation were in one activity i need to show status bar. any buddy know how to forcefully made changes as it first apply the theme so how can i code to forcefully show only status bar not actionbar.

thanks

1 Answer 1

2

in the activity where you want the status bar, you can try this code:

getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN); 

then if you have your title defined just make it visible, for example

((View) findViewById(android.R.id.title)).setVisibility(View.VISIBLE); 
Sign up to request clarification or add additional context in comments.

3 Comments

thanks for your reply it works but status bar is overlaying my activity its default look (black color )is changed with activities gray color.is there any way to change it to default color. we had method setstatusbarcolor() color available in api level 21 is there any other way to support older api
to change status bar color for below api 21 is not supported, check here stackoverflow.com/questions/26496411/…, and can you up vote my answer if it helped you
thanks for your reply do you have any idea to close the activity with transition effect

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.