1
我在我的項目中定義了一個新的活動,並且我在fullScreen中遇到了一些問題。活動並不全屏顯示
我喜歡這個清單文件中定義:
<activity android:name=".Test"
android:launchMode="singleInstance" android:screenOrientation="portrait"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
.............
>
如果我開始從另一個活動的活動,我得到了想要的全屏幕。問題是,當我從廣播接收器開始這個活動 - 我需要打開一個BroadcastReceiver這樣的事情這裏面活動:
public void onReceive(Context context, Intent intent) {
Intent test = new Intent(context, Test.class);
test.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
context.startActivity(test);
}
我想這樣太:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.test);
}
,並沒有全屏如果該活動從我的BroadcastReciever開始。
爲什麼我沒有在這種情況下獲得全屏?活動創建並可見後,有什麼方法可以請求全屏?