0
votes

I have two activities in my application.one of the activity started by service class ,so i have set the flag FLAG_ACTIVITY_NEW_TASK and start the activity.

in that activity i hide the status bar by using the following code .

getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN)

The problem is some time the activity not hiding the statusbar.After doing several testing i found that the FLAG_ACTIVITY_NEW_TASK is creating problem.

how to solve this?

1
are you calling it before setContentView ?Sherif elKhatib
it is interesting to know "how did you discover that this is being caused by FLAG_ACTIVITY_NEW_TASK"Sherif elKhatib

1 Answers

2
votes

What if you do that directly in the XML:

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