I know this question has been asked million times but whichever method I use is not good for me.
If I use
android:theme=\"@android:style/Theme.NoTit
If you add the theme to the application, it applies to the whole app.
android:theme="@android:style/Theme.NoTitleBar"
You have to add it to the activity declaration.
<activity
android:name=".YourActivity"
android:theme="@android:style/Theme.NoTitleBar"/>
This is what worked for me
android:theme="@style/Theme.AppCompat.NoActionBar">
For android 8 and above support. Use this in your app theme file. I've modified my default in res/styles.xml :
<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>
<item name="android:windowNoTitle">true</item>
<item name="android:background">@color/white</item>
</style>