Reputation: 273
I'm trying disable the toolbar in my Login Activity. I have tried all the methods i could find so far.
<application
android:name="app.AppController"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
activity
android:name=".LoginActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
here is my styles xml file
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
I have even tried to remove it programatically with
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
also removed these lines of codes.
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
still no luck. I dont see the toolbar in my design preview in android studio. But when i run the app using the emulator it shows the toolbar. I'm emulating it on a Nexus 4 with the api 22.
Have i missed anything or done something wrong? Can anyone point me in the right direction.
Upvotes: 1
Views: 1927
Reputation: 273
I have forgotten to remove the toolbar from the activity xml. I had only removed the toolbar from the content xml file.
Upvotes: 1