Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a custom status bar in android common for all activity in android?

Tags:

android

I am developing a small application. I want to add my own Status bar at the top of my application with black background containing the battery, 3g,network and an icon of my choice. Please guyz help me out in creating a custom status bar..Thanks in advance

like image 421
Prachi Avatar asked Feb 03 '26 21:02

Prachi


2 Answers

yes that is quite possible...

1- Make your application full screen.

2- Create a linear layout (as you wish)

3- if app contains more than one activity, include the layout in every layout...

For app full screen:

requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                            WindowManager.LayoutParams.FLAG_FULLSCREEN);

Status bar design depends on you...

like image 97
Farhan Avatar answered Feb 06 '26 10:02

Farhan


If by "top status bar" you mean where the battery meter and signal meter and notifications go, you cannot change it from an app. You can set a theme to remove it (e.g., Theme.NoTitleBar.Fullscreen).

I believe you can use a custom view for the app's title bar. See the answers to this question:

Custom title with image

like image 27
Udaykiran Avatar answered Feb 06 '26 11:02

Udaykiran



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!