保存方向更改的多个数据

时间:2013-07-27 20:29:56

标签: android performance android-layout android-orientation

我必须在方向更改时保存多个整数数组如何操作。 这是我为保存一个值而看到的代码。

@Override​
​​​​public ​void​ onSaveInstanceState(Bundle ​outState)​ {
​​​​​​​​//--- save​ what ever​ you​ need ​to ​persist ---
​​​​​​​​outState.putString("ID", "1234567890");
​​​​​​​​super.onSaveInstanceState(outState);
​​}

@Override
​​​​public ​void​ onRestoreInstanceState(Bundle ​savedInstanceState)​ {
 ​​​​​​​​super.onRestoreInstanceState(savedInstanceState);
 String ​ID​ = ​savedInstanceState.getString("ID");

      }

1 个答案:

答案 0 :(得分:0)