public static int onActivityReenter(final Activity activity, final ImageGalleryView imageGallery, final Intent data) {
        final int pos = data == null || data.getExtras() == null ? -1 : data.getExtras().getInt(ImageViewActivity.EXTRA_IMAGEVIEW_POS, -1);
        if (pos >= 0) {
            activity.postponeEnterTransition();
            if (imageGallery != null) {
                imageGallery.initializeToPosition(pos);
                imageGallery.activityReenterCalled = true;
            }
        }
        return pos;
    }
Important: include this in your activity's "onActivityReenter" method.
Needed e.g. for correct back transition when returning from detail view (e.g. scrolling to image gallery position)
main/src/main/java/cgeo/geocaching/ui/ImageGalleryView.java