0

I have an activity_login.xml with a FrameLayout in Android Studio, which doesn't appear in fullscreen mode with this configuration:

AndroidManifest.xml:

<activity
    android:name=".Activities.LoginActivity"
    android:label="@string/title_activity_login"
    android:launchMode="singleTop"
    android:theme="@style/LoginScreenTheme.TranslucentBar" >
</activity>

Styles.xml:

<style name="LoginScreenTheme.TranslucentBar" parent="Theme.AppCompat.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:windowTranslucentStatus">true</item>
    <item name="android:windowTranslucentNavigation">true</item>
</style>

The Toolbar is still appearing in the Layout.

vidulaJ
  • 1,232
  • 1
  • 16
  • 31
Tabo
  • 31
  • 6

4 Answers4

0

Look at your activity Layout, most likely there is Toolbar view that AndroidStudio generated for you. If that does not work add to the style:

<item name="android:windowFullscreen">true</item>
X3Btel
  • 1,408
  • 1
  • 13
  • 21
0

Modify onCreateView() as below

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

        requestWindowFeature(Window.FEATURE_NO_TITLE);
        this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
    }
EKN
  • 1,886
  • 1
  • 16
  • 29
0

In order to remove the Toolbar/ActionBar you don't need to do anything special at all. Just keep everything as default and go to the styles.xml and change the AppTheme to Theme.AppCompat.Light.NoActionBar and also make sure that your activity extends AppCompactActivity. It always works for me. Hope it will help you as well. And if you also wants to remove the StatusBar then follow @EKN solution above ;)

0

I don't do anything and today when I started my project, the activity was in fullscreen.

Tabo
  • 31
  • 6