androidandroid-activityfirebaseandroid-titlebar

Remove header from Activity


I am using firebase UI android library and my main activity inherits from FirebaseLoginBaseActivity.

For some odd reason a title bar was added to my main view which I don't know how to get rid of since it does not appear in my layout xml.

When trying this:

super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_google_maps);

In the onCreate it fails with this message:

android.util.AndroidRuntimeException: requestFeature() must be called before adding content

When trying to set this:

android:theme="@android:style/Theme.NoTitleBar"

In the AndroidManifest.xml it fails with this message:

You need to use a Theme.AppCompat theme (or descendant) with this activity.


Solution

  • Try setting your base theme to android:theme="@style/Theme.AppCompat.Light.NoActionBar" instead of android:theme="@android:style/Theme.NoTitleBar".