在特殊情況下,我需要從 Activity 中刪除對話框主題,就下面這個例子,如何實現呢?
First activity:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
startActivity(new Intent(MainActivity.this, SecondActivity.class));
}
Second activity:
public void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setTheme(android.R.style.Theme);
setContentView(R.layout.activity_second);
}
Manifest excerpt:
<activity android:name="SecondActivity" android:theme="@android:style/Theme.Dialog"></activity>
但我在API10 上運行後,對話框主題仍然存在,如何刪除?
setTheme(android.R.style.Theme);
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_second);