<NME> ImagesActivity.java
<BEF> package cgeo.geocaching;

import cgeo.geocaching.activity.AbstractActionBarActivity;
import cgeo.geocaching.models.Image;
import cgeo.geocaching.ui.ImagesList;
import cgeo.geocaching.ui.ImagesList.ImageType;

import org.apache.commons.collections4.CollectionUtils;
import rx.Subscription;

import android.content.Context;
import android.view.View;

import androidx.annotation.NonNull;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.rxjava3.disposables.CompositeDisposable;
import org.apache.commons.collections4.CollectionUtils;

public class ImagesActivity extends AbstractActionBarActivity {

    private List<Image> imageNames;
    private ImagesList imagesList;
    private final CompositeDisposable createDisposables = new CompositeDisposable();

    private Subscription subscription;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // get parameters
        String geocode = null;
        if (extras != null) {
            geocode = extras.getString(Intents.EXTRA_GEOCODE);
        }

        if (extras == null || geocode == null) {
            showToast("Sorry, c:geo forgot for what cache you want to load spoiler images.");
            finish();
            return;
        }

        // init
        setTheme();
        setContentView(R.layout.images_activity);

        setCacheTitleBar(geocode);

        imagesList = new ImagesList(this, geocode, null);

        imageNames = extras.getParcelableArrayList(Intents.EXTRA_IMAGES);
        if (CollectionUtils.isEmpty(imageNames)) {
            showToast(res.getString(R.string.warn_load_images));
            finish();
        }
    }

    @Override
    public void onStart() {
        super.onStart();
        createDisposables.add(imagesList.loadImages(findViewById(R.id.spoiler_list), imageNames));
    }

    @Override
    public void onStop() {
        // Reclaim native memory faster than the finalizers would
        createDisposables.clear();
        super.onStop();
    }

    public static void startActivity(final Context fromActivity, final String geocode, final List<Image> logImages) {
        final Intent logImgIntent = new Intent(fromActivity, ImagesActivity.class)
                .putExtra(Intents.EXTRA_GEOCODE, geocode);

        super.onStop();
    }

    public static void startActivityLogImages(final Context fromActivity, final String geocode, List<Image> logImages) {
        startActivity(fromActivity, geocode, logImages, ImageType.LogImages);
    }

    private static void startActivity(final Context fromActivity, final String geocode, List<Image> logImages, ImageType imageType) {
        final Intent logImgIntent = new Intent(fromActivity, ImagesActivity.class);
        // if resuming our app within this activity, finish it and return to the cache activity
        logImgIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET)
    @Override
    public boolean onContextItemSelected(@NonNull final MenuItem item) {
        if (imagesList.onContextItemSelected(item)) {
            return true;
        }
        return super.onContextItemSelected(item);
        fromActivity.startActivity(logImgIntent);
    }

    public static void startActivitySpoilerImages(final Context fromActivity, String geocode, List<Image> spoilers) {
        startActivity(fromActivity, geocode, spoilers, ImageType.SpoilerImages);
    }

    @Override
    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
        super.onCreateContextMenu(menu, v, menuInfo);
        imagesList.onCreateContextMenu(menu, v);
    }

    @Override
    public boolean onContextItemSelected(MenuItem item) {
        if (imagesList.onContextItemSelected(item)) {
            return true;
        }

<MSG> use level21 for building and as target

* Set targetSdk of main application to 21. This disables compatibility
modes as described in
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html#LOLLIPOP
and
http://developer.android.com/reference/android/os/Build.VERSION_CODES.html#KITKAT_WATCH
* Set compile target to 21 for main app and play services.
* Suppress deprecation warnings, as there is no replacement for the
deprecated API on lower API levels.

Tested with Eclipse and Ant, on a 4.4 and 5.0.2 device. IDEA probably
needs further changes.
<DFF> @@ -6,6 +6,7 @@ import cgeo.geocaching.ui.ImagesList;
 import cgeo.geocaching.ui.ImagesList.ImageType;
 
 import org.apache.commons.collections4.CollectionUtils;
+
 import rx.Subscription;
 
 import android.content.Context;
@@ -28,7 +29,7 @@ public class ImagesActivity extends AbstractActionBarActivity {
     private Subscription subscription;
 
     @Override
-    public void onCreate(Bundle savedInstanceState) {
+    public void onCreate(final Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
 
         // get parameters
@@ -78,11 +79,12 @@ public class ImagesActivity extends AbstractActionBarActivity {
         super.onStop();
     }
 
-    public static void startActivityLogImages(final Context fromActivity, final String geocode, List<Image> logImages) {
+    public static void startActivityLogImages(final Context fromActivity, final String geocode, final List<Image> logImages) {
         startActivity(fromActivity, geocode, logImages, ImageType.LogImages);
     }
 
-    private static void startActivity(final Context fromActivity, final String geocode, List<Image> logImages, ImageType imageType) {
+    @SuppressWarnings("deprecation")
+    private static void startActivity(final Context fromActivity, final String geocode, final List<Image> logImages, final ImageType imageType) {
         final Intent logImgIntent = new Intent(fromActivity, ImagesActivity.class);
         // if resuming our app within this activity, finish it and return to the cache activity
         logImgIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET)
@@ -95,18 +97,18 @@ public class ImagesActivity extends AbstractActionBarActivity {
         fromActivity.startActivity(logImgIntent);
     }
 
-    public static void startActivitySpoilerImages(final Context fromActivity, String geocode, List<Image> spoilers) {
+    public static void startActivitySpoilerImages(final Context fromActivity, final String geocode, final List<Image> spoilers) {
         startActivity(fromActivity, geocode, spoilers, ImageType.SpoilerImages);
     }
 
     @Override
-    public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
+    public void onCreateContextMenu(final ContextMenu menu, final View v, final ContextMenuInfo menuInfo) {
         super.onCreateContextMenu(menu, v, menuInfo);
         imagesList.onCreateContextMenu(menu, v);
     }
 
     @Override
-    public boolean onContextItemSelected(MenuItem item) {
+    public boolean onContextItemSelected(final MenuItem item) {
         if (imagesList.onContextItemSelected(item)) {
             return true;
         }

use level21 for building and as target