0

I am trying to remove title bar from my activity but it is not getting removed.

Here is my code

public class SplashScreen extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        requestWindowFeature(Window.FEATURE_NO_TITLE);

        setContentView(R.layout.activity_splash_screen);


    }
}

With or without the requestWindow line the output is the same then what is the use of that line?

Ankit Srivastava
  • 135
  • 4
  • 11
  • 1
    Just like this `` – KeLiuyue Jul 25 '17 at 02:13
  • In your manifest.xml file inside the Activity tag add this android:theme="@android:style/Theme.NoTitleBar.Fullscreen" – Fr099y Jul 25 '17 at 03:05

4 Answers4

1

I would reccomend editing your theme with no title bar. For example use of of these...

<style name="Theme.NoTitle" parent="@android:style/Theme.NoTitleBar"></style>
<style name="Theme.FullScreen" 
parent="@android:style/Theme.NoTitleBar.Fullscreen"></style>
Jared
  • 2,029
  • 5
  • 20
  • 39
1

Apply this theme in your activity declared in the Manifest File.

<activity
    android:name=".SplashScreenActivity"
    android:theme="@style/Theme.AppCompat.Light.NoActionBar">
</activity>
Rishabh Sharma
  • 270
  • 5
  • 17
1

Can you try adding this to your manifest inside activity tag :

<activity
        android:name="your_app_packagename.activity_name"
        android:theme="@android:style/Theme.NoTitleBar" >

also try this in your activity :

ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(false);
0

Add this in onCreate

   getSupportActionBar().setDisplayShowTitleEnabled(false);
   getSupportActionBar().setDisplayShowHomeEnabled(false);
John Joe
  • 12,412
  • 16
  • 70
  • 135