private void restoreState(final Bundle bundle) {
        //restore imageList
        imageList.clear();
        final int imageListCacheId = bundle.getInt(PARAM_IMAGE_LIST_CACHEID, -1);
        if (imageListCacheId > -1) {
            if (IMAGE_LIST_CACHE_ID.get() == imageListCacheId) {
                imageList.addAll(IMAGE_LIST_CACHE);
                IMAGE_LIST_CACHE.clear();
            } else {
                for (int i = 0; i < bundle.getInt(PARAM_IMAGE_LIST_SIZE); i++) {
                    imageList.add(null);
                }
                int insertPos = bundle.getInt(PARAM_IMAGE_LIST_STARTPOS, 0);
                final ArrayList<Image> extrasImgList = bundle.getParcelableArrayList(PARAM_IMAGE_LIST);
                if (extrasImgList != null) {
                    for (Image img : extrasImgList) {
                        imageList.set(insertPos, img);
                        insertPos++;
                    }
                }
            }
        } else {
            final ArrayList<Image> extrasImgList = bundle.getParcelableArrayList(PARAM_IMAGE_LIST);
            if (extrasImgList != null) {
                imageList.addAll(extrasImgList);
            }
        }

        if (imageList.isEmpty()) {
            imageList.add(null);
        }
        imagePos = Math.max(0, Math.min(imageList.size() - 1, bundle.getInt(PARAM_IMAGE_LIST_POS, 0)));

        imageContextCode = bundle.getString(PARAM_IMAGE_CONTEXT_CODE);
        fullImageView = bundle.getBoolean(PARAM_FULLIMAGEVIEW, false);
        showImageInformation = bundle.getBoolean(PARAM_SHOWIMAGEINFO, true);
    }
sets properties for activity to enable smooth image transation between master/list and detail activity
main/src/main/java/cgeo/geocaching/ImageViewActivity.java