Android onConfiguration更改未被调用
我在告诉Android在方向改变时不要打电话时遇到了麻烦。我已经添加到我的清单中,但仍然在调用方向更改时。这是我的代码。onCreate()
android:configChanges="orientation"
onCreate()
AndroidManifest.xml
<activity android:name="SearchMenuActivity" android:theme="@android:style/Theme.NoTitleBar" android:configChanges="orientation"></activity>
搜索菜单活动.java
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Set the current layout to the search_menu
setContentView(R.layout.search_menu_activity);
Log.d(TAG, "onCreate() Called");
}
@Override
public void onConfigurationChanged(Configuration newConfig) {
//don't reload the current page when the orientation is changed
Log.d(TAG, "onConfigurationChanged() Called");
super.onConfigurationChanged(newConfig);
}
和我的 LogCat 输出
06-23 12:33:20.327: DEBUG/APP(2905): onCreate() Called
//Orientation Changes
06-23 12:33:23.842: DEBUG/APP(2905): onCreate() Called
有谁知道我做错了什么?谢谢。