Save Restore Array List Android Example

        int[] mArrayOfInt;
        String[] mArrayOfString;
        List<String> mList;
        public void saveState(Bundle map)
        {
                map.putIntArray("mArrayOfInt", mArrayOfInt);
                map.putStringArray("mArrayOfString", mArrayOfString);
                map.putStringArrayList("mList", mList);
        }
 
        public void restoreState(Bundle map)
        {
                mArrayOfInt= map.getIntArray("mArrayOfInt");
                mArrayOfString = map.getStringArray("mArrayOfString");
                mList = map.getStringArrayList("mList");
 
        }
This entry was posted in Android Examples Code, Array,List,Collections and tagged , , . Bookmark the permalink.


Comments are closed.



5,509 views