0

I am using android studio 2.2.3. How can i remove title bar from my application? I am tried by putting

<activity android:name=".ActivityName"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">
</activity>

in AndroidManifest.xml file but it doesn't worked.

Here is screenshot my project My Project

My Style.xml file code is

<style>
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item> </style>

What should have to change in style.xml file?

Harsh Trivedi
  • 5,591
  • 3
  • 12
  • 14

3 Answers3

2

Add this style in Style.xml

<!-- Base application theme. -->
    <style name="AppBaseTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->

    </style>
    <style name="AppTheme" parent="AppBaseTheme">
        - <!--  All customizations that are NOT specific to a particular API-level can go here.
  -->
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowActionBar">false</item>
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
Akp
  • 259
  • 1
  • 9
1

Programmatic way

  @Override
    protected void onCreate(Bundle savedInstanceState) {
       super.onCreate(savedInstanceState);
       this.requestWindowFeature(Window.FEATURE_NO_TITLE);
       this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); 
       setContentView(R.layout.your_xml);
IntelliJ Amiya
  • 74,896
  • 15
  • 165
  • 198
0

Just change your line this way

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

to

android:theme="@style/Theme.AppCompat.NoActionBar"
TysonSubba
  • 1,362
  • 2
  • 12
  • 16