第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

旋轉(zhuǎn)屏幕棋子還是會(huì)消失

代碼如下:

private static final String INSTANCE = "instance";
private static final String INSTANCE_GAMEOVER = "instance_gameover";
private static final String INSTANCE_WHITE_ARRAY = "instance_black_array";
private static final String INSTANCE_BLACK_ARRAY = "instance_white_array";

// ? 保存view
@Override
protected Parcelable onSaveInstanceState() {
? ?Bundle bundle = new Bundle();
? ?// ?保存游戲內(nèi)部的狀態(tài)保存在 INSTANCE 中
? ?bundle.putParcelable(INSTANCE,super.onSaveInstanceState());
? ?bundle.putBoolean(INSTANCE_GAMEOVER,mIsGameOver);
? ?bundle.putParcelableArrayList(INSTANCE_WHITE_ARRAY,mWhiteArray);
? ?bundle.putParcelableArrayList(INSTANCE_BLACK_ARRAY,mBlackArray);
? ?return bundle;
}
// ? 恢復(fù)View ?屏幕旋轉(zhuǎn)后View 不變
@Override
protected void onRestoreInstanceState(Parcelable state) {
? ?if(state instanceof Bundle){
? ? ? ?Bundle bundle = (Bundle) state;
? ? ? ?mIsGameOver = bundle.getBoolean(INSTANCE_GAMEOVER);
? ? ? ?mWhiteArray = bundle.getParcelableArrayList(INSTANCE_WHITE_ARRAY);
? ? ? ?mBlackArray = bundle.getParcelableArrayList(INSTANCE_BLACK_ARRAY);
? ? ? ?// ?獲取游戲內(nèi)部INSTANCE中保存的數(shù)據(jù)
? ? ? ?super.onRestoreInstanceState(bundle.getParcelable(INSTANCE));
? ? ? ?return;
? ?}
? ?super.onRestoreInstanceState(state);
}

另外給View 也設(shè)置了id ?

為什么不保存?。?/p>

正在回答

1 回答

id設(shè)置是五子棋的那個(gè)panel要設(shè)置id


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
Android-五子連珠
  • 參與學(xué)習(xí)       38999    人
  • 解答問題       174    個(gè)

Android游戲開發(fā)-五子連珠,本教程通過UI與邏輯實(shí)現(xiàn)雙人對(duì)戰(zhàn)

進(jìn)入課程

旋轉(zhuǎn)屏幕棋子還是會(huì)消失

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)