ArrayList在類級別上定義。 這些都是我savedInstance方法:在包中保存ArrayList savedInstanceState
@Override
protected void onSaveInstanceState(Bundle outState) {
super.onSaveInstanceState(outState);
outState.putStringArrayList("savedList", list);
}
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
list=savedInstanceState.getStringArrayList("savedList");
}
但儘管如此,當我改變方向ArrayList中是空白
http://stackoverflow.com/a/4967491/1001401 嘗試從得到的onCreate(捆綁savedInstanceState)您的ArrayList savedInstanceState – nfirex 2013-04-28 16:10:03