我有一个视图寻呼机,可以在其中显示一些可编辑的项目。当用户编辑项目时,我需要保存它们,以便在用户再次打开所述屏幕时再次显示它们。我尝试将保存例程放在“saveState”方法中,但是,该方法永远不会被调用
我可以用哪种方法保存我需要的数据?
@Override
public void destroyItem(View collection, int position, Object view) {
Log.d(TAG, "destroyItem "+position);
((ViewPager) collection).removeView((View) view);
}
@Override
public boolean isViewFromObject(View view, Object object) {
Log.d(TAG, "isViewFromObject");
return view == ((View) object);
}
@Override
public void finishUpdate(View view) {
Log.d(TAG, "finishUpdate");
}
@Override
public void restoreState(Parcelable arg0, ClassLoader arg1) {
Log.d(TAG, "restoreState");
}
@Override
public Parcelable saveState() {
Log.d(TAG, "saveState");
return null;
}
@Override
public void startUpdate(View view) {
Log.d(TAG, "startUpdate");
}