關(guān)于把輪到哪個棋子走的狀態(tài)保存下來的問題,請大神們來給我看看
????@Override ????protected?Parcelable?onSaveInstanceState()?{ ????????Bundle?bundle=new?Bundle(); ????????bundle.putParcelable(INSTANCE,super.onSaveInstanceState()); ????????bundle.putBoolean(INSTANCE_GAME_OVER,mIsGameOver); ????????//bundle.putBoolean(INSTANCE_IS_WHITE,mIsWhite); ????????bundle.putParcelableArrayList(INSTANCE_WHITE_ARRAY,(ArrayList)mWhiteArray); ????????bundle.putParcelableArrayList(INSTANCE_BLACK_ARRAY,(ArrayList)mBlackArray);???????? ????????return?bundle; ????}???? ????@Override ????protected?void?onRestoreInstanceState(Parcelable?state)?{??????? ????????if(state?instanceof?Bundle)?{ ????????????Bundle?bundle=(Bundle)state; ????????????mIsGameOver=bundle.getBoolean(INSTANCE_GAME_OVER); ????????????//mIsWhite=bundle.getBoolean(INSTANCE_IS_WHITE); ????????????mWhiteArray=bundle.getParcelableArrayList(INSTANCE_WHITE_ARRAY); ????????????mBlackArray=bundle.getParcelableArrayList(INSTANCE_BLACK_ARRAY);???????????? ????????????super.onRestoreInstanceState(bundle.getParcelable(INSTANCE)); ????????????return; ????????}???????? ????????super.onRestoreInstanceState(state); ????}
這個項目我還沒開始做呢,看到view的存儲的時候發(fā)現(xiàn)了這個缺陷,要把輪到哪個棋子走的這個狀態(tài)也要保存下來吧,不知道我注釋的那一段是否正確,請大神們指出來,謝謝 ~