How I can change background color of titlebar without using theme. tnks in Android.
Try with the following code
View titleView = getWindow().findViewById(android.R.id.titlebar);
if (titleView != null) {
ViewParent parent = titleView.getParent();
if (parent != null && (parent instanceof View)) {
View parentView = (View)parent;
parentView.setBackgroundColor(Color.RED);
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With