I
I
Ivan Sorokin2015-10-08 14:47:01
Java
Ivan Sorokin, 2015-10-08 14:47:01

How to make a status bar in java?

How to make a status bar for an android smartphone in java?
For example, as in (Android L)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Grigory Kalyashov, 2015-10-08
@vpranker

Window window = activity.getWindow();
window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
window.setStatusBarColor(activity.getResources().getColor(R.color.твой_primaryColor));

To change color:
getWindow().setStatusBarColor(Color.RED);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question