1
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, 
                                WindowManager.LayoutParams.FLAG_FULLSCREEN);        

setContentView(R.layout.activity_main);

Using the above code only causes app to crash - also

<activity android:name=".MainActivity"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Holo.Light.NoActionBar.Fullscreen">
</activity>

Does not work

Mark James
  • 481
  • 2
  • 6
  • 18

2 Answers2

0

try to define a custom theme like this:

<style name="MyTheme" parent="Theme.AppCompat">
<item name="android:windowNoTitle">false</item>
<item name="android:windowActionBar">false</item>
</style>

and set the theme as your activity theme in manifest

<activity
        android:name=".Activity.File"
        android:theme="@style/MyTheme" />

it works on my app.

cmnewfan
  • 129
  • 1
  • 9
0

Try the following

 <style name="MyTheme" parent="android:Theme.Material.Light.NoActionBar">
<item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
</style>
Alvin Varghese
  • 679
  • 2
  • 9
  • 17