Bundle 2 SparseArray に格納する必要があります。
だからここにあります:
protected void onSaveInstanceState(Bundle state) {
super.onSaveInstanceState(state);
state.putSparseParcelableArray("guybrushInsulti", (SparseArray<String>) gameEngine.getDialogs().getInsultKnow());
state.putSparseParcelableArray("guybrushControInsulti",(SparseArray<String>) gameEngine.getDialogs().getControInsultKnow());
state.putSerializable("level", gameEngine.getWorld().getLevel());
}
エクリプス 言います:
The method putSparseParcelableArray(String, SparseArray<? extends Parcelable>) in the type Bundle is not applicable for the arguments (String, SparseArray<String>)
OnRestoreInstanceState:
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
SparseArray<String> mInsultiKnow = savedInstanceState.getSparseParcelableArray("guybrushInsulti");
SparseArray<String> mControInsultiKnow = savedInstanceState.getSparseParcelableArray("guybrushControInsulti");
//Ripristino insulti
gameEngine.getDialogs().loadControInsult(mLevel , true);
gameEngine.getDialogs().loadInsult(mLevel, true, mInsultiKnow, mControInsultiKnow);
}
エラー:
Bound mismatch: The generic method getSparseParcelableArray(String) of type Bundle is not applicable for the arguments (String). The inferred type String is not a valid substitute for the bounded parameter <T extends Parcelable>
私の問題は何ですか?:(