/**
* 存图片的路径
*/
@Override
protected void onSaveInstanceState(Bundle outState) {
if (sdImageFile != null) {
Timber.i("onSaveInstanceState -- not -- null");
outState.putString(UPLOAD_PHOTO_STATUS, sdImageFile.getAbsolutePath());
}
outState.putString(UPLOAD_PHOTO_LIST_ID, listId);
Timber.i("onSaveInstanceState----outState");
super.onSaveInstanceState(outState);
}
/**
* 取图片的路径
*/
@Override
protected void onRestoreInstanceState(Bundle savedInstanceState) {
super.onRestoreInstanceState(savedInstanceState);
Timber.i("onRestoreInstanceState");
String photoStatus = savedInstanceState.getString(UPLOAD_PHOTO_STATUS);
if (sdImageFile == null && !TextUtils.isEmpty(photoStatus)) {
Timber.i("new File(photoStatus);");
sdImageFile = new File(photoStatus);
}
String photoListId = savedInstanceState.getString(UPLOAD_PHOTO_LIST_ID);
if (TextUtils.isEmpty(listId) && !TextUtils.isEmpty(photoListId)) {
Timber.i("new File(photoListId);");
listId = photoListId;
}
}