Search code examples
javaandroidstatusbarandroid-statusbar

Android hide app/activity name on status bar


I would like to hide status bar app name and leave only icon. (And add button + spinner but i know how to do it) I search in google and on stackoverflow but the only thing that I found is how to hide whole status bar.

I just want to do something like this:

Link to screen


Solution

  • your problem can be solved easily following this actions:

    1. Using a empty activity title (you can set the title with a empty string like "")

    2. Use a spinner inside Toolbar layout with the spinner that your want.

      <android.support.v7.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize"
          android:background="?attr/colorPrimary"
          app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
      
          <Spinner
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"/>
      </android.support.v7.widget.Toolbar>
      
    3. Do whatever your want with your spinner. :)