我在我的佈局中使用了一個gestureOverlayView,用於繪製數字簽名。當我繪製某個方向(如風景)然後改變方向時,問題就會出現 - overlayView剛好清除。我試過包括onConfigurationChanged();但沒有效果。我也試圖與onSaveInstance和onRestoreInstance以下,但它給了我無解:手勢在方向改變時清除
@Override
protected void onSaveInstanceState(Bundle outState) {
Gesture gesture = overlay.getGesture();
outState.putParcelable("gesture", (Parcelable) gesture);
super.onSaveInstanceState(outState);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
Gesture gesture = (Gesture) savedInstanceState.getParcelable("gesture");
overlay.setGesture(gesture);
mDoneButton.setEnabled(true);
super.onRestoreInstanceState(savedInstanceState);
}
我自己也嘗試包括:
android:configChanges="fontScale|uiMode|screenLayout|navigation|touchscreen|mcc|mnc|orientation|keyboardHidden|keyboard">
但是,即使這是沒有用的。
有沒有人有這個問題的解決方案?
嘿感謝您的編輯喬恩你能也幫我弄了上述回答 – 2011-04-20 04:15:18