我已經爲我的應用程序中的所有活動提供了清單中的所有權限,但我的活動在旋轉手機時重新開始。重新啓動解散我的警報框,再次調用Web服務器獲取數據和活動確實保持了以前的狀態。我曾嘗試過所有可能性,但無法獲得解決方案。我該如何解決這個問題?在android中旋轉手機時警告對話框被取消
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.station_list_layout);
ConstantValues.CURRENT_ACTIVITY=StationListActivity.this;
ConstantValues.NEAREST_PLACE_MENU_SLIDER_FLAG=false;
ConstantValues.MESSAGE_MENU_SLIDER_FLAG=false;
ConstantValues.STATION_LIST_MENU_SLIDER_FLAG=true;
orientation=getResources().getConfiguration().orientation;
userAndMessageCount=new UserAndMessageCount();
((TextView)findViewById(R.id.stationlist_route_name)).setText(ConstantValues.ROUTE_NAME);
list = (ListView) findViewById(R.id.myListView);
Cursor cursor=new UpdateLocalDatabase().getStationNameByRoute();
adapter=new StationListAdapter(StationListActivity.this, cursor);
adapter.notifyDataSetChanged();
if(!ConstantValues.STATION_LIST_LOATED)
userAndMessageCount.execute();
else
{
Footer.setMsgCount(ConstantValues.MSG_COUNT);
Footer.setUserCount(ConstantValues.FAVORITE_STATION_LIST.size());
list.setAdapter(adapter);
}
}
<activity
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="unspecified"
android:name=".LaunchingPageActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>`
http://developer.android.com/guide/topics/resources/runtime-changes.html – RobinHood 2013-04-05 05:06:14
你必須要求兩種模式? – Harshid 2013-04-05 05:12:39
是的,我需要兩種模式 – SathishKumar 2013-04-05 05:14:00