I took as a basis an example from the Android Universal-Image-Loader removed all unnecessary, slightly redid, and now I just want to reuse the gallery in the project. Gallery takes pictures from the file Constants.java.
public class Constants{ private static String[] image1= new String[] { // Heavy images "https://img1.goodfon.ru/original/1440x900/2/96/art-sono-devushki-shkolnicy.jpg", "https://img1.goodfon.ru/original/1440x900/2/96/art-sono-devushki-shkolnicy.jpg", "https://img1.goodfon.ru/original/1440x900/2/96/art-sono-devushki-shkolnicy.jpg" }; private static String[] image2= new String[] { // Heavy images "https://img1.goodfon.ru/original/1440x900/2/96/art-sono-devushki-shkolnicy.jpg", "https://img1.goodfon.ru/original/1440x900/2/96/art-sono-devushki-shkolnicy.jpg", "https://img1.goodfon.ru/original/1440x900/2/96/art-sono-devushki-shkolnicy.jpg" }; public static String[] IMAGES = Metal; private Constants() {} public static class Config { public static final boolean DEVELOPER_MODE = false; } public static class Extra { public static final String FRAGMENT_INDEX = "com.nostra13.example.universalimageloader.FRAGMENT_INDEX"; public static final String IMAGE_POSITION = "com.nostra13.example.universalimageloader.IMAGE_POSITION"; } } Initially public static String[] IMAGES was assigned an array of links. And then it was all called in another activity that was processed and output. Now did as in the code above. And I want, depending on which gallery is running, to assign IMAGES appropriate array of links. For example, something like this:
public static String[] IMAGES; public static String iden = "iMetal"; switch (iden) { case "iMetal": IMAGES = Metal; break; ... } But he writes an unexpected token switch error.
The variable iden planned to transfer from another activity when the gallery was launched.