0

One of my activities has suddenly changed its color in the statusbar. By default it's black, but now it's transparent, why?

I've marked around the bar with a circle. By default this is black

My XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:scaleType="centerInside"
    android:id="@+id/do2get"
    android:src="@drawable/loading"
    android:layout_alignParentTop="true"
    android:layout_alignParentStart="true"
    android:layout_marginLeft="30dp" />

<ProgressBar
    style="?android:attr/progressBarStyleLarge"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:indeterminateTint="#00796b"
    android:id="@+id/progressBar"
    android:layout_below="@+id/do2get"
    android:layout_centerHorizontal="true"
    android:indeterminateTintMode="src_in"/>
</RelativeLayout>
Hudhud
  • 61
  • 1
  • 10
  • Check the activity's Theme in the manifest file.. – Mike Dec 02 '15 at 19:49
  • I've put it as `android:theme="@style/AppTheme.NoActionBar" >` but I want the start at the top of the screen (with the clock and WIFI signal) – Hudhud Dec 02 '15 at 19:53

1 Answers1

1

I think its all about your actitiy`s theme. First of all check this links:

How to change the status bar color in android

How to change the background color of android status bar

Maybe your base theme has attribute "android:windowTranslucentStatus" = true or "colorPrimaryDark = @android:color/transparent" etc. So you need to create new one style like:

<style name="YourActivityTheme" parent="BaseAppTheme">
    <item name="android:windowTranslucentStatus">false</item>
    <item name="android:statusBarColor">@android:color/black</item>
</style>

and then set this style to current activity theme in AndroidManifest:

<aplication
        ....... >
            .......    

         <activity
                android:name=".chapters.home.YourNiceActivity"
                android:theme="@style/YourActivityTheme">
                <intent-filter>
                   ...
                </intent-filter>
        </activity>

    .....
</application>
Community
  • 1
  • 1