Android 图像阵列

Android 图像阵列,android,android-image,Android,Android Image,在我的应用程序中,我定制了包含图像和文本信息的SwipeAdapter。 我在这段平静的代码中设置了图像: private int[] image_resources = { R.drawable.wl1, R.drawable.wl2, R.drawable.wl3, R.drawable.wl4, R.drawable.wl5, R.drawable.wl6, R.drawable

在我的应用程序中,我定制了包含图像和文本信息的SwipeAdapter。 我在这段平静的代码中设置了图像:

private int[] image_resources = {
        R.drawable.wl1,
        R.drawable.wl2,
        R.drawable.wl3,
        R.drawable.wl4,
        R.drawable.wl5,
        R.drawable.wl6,
        R.drawable.wl7,
        R.drawable.wl8,
        R.drawable.wl9,
        R.drawable.wl10}; and so on..
现在我可以从Parse.com下载图像:

                  ParseFile backgroundImage = (ParseFile) parseObj.get("backgroundImage");
                    backgroundImage.getDataInBackground(new GetDataCallback() {
                        public void done(byte[] data, ParseException e) {
                            if (e == null) {

                                try {
                                    bitmap_backgroundImage = BitmapFactory.decodeByteArray(data, 0, data.length);
                                    ContextWrapper cw1 = new ContextWrapper(getApplicationContext());
                                    File directory = cw1.getDir("backgroundimage", Context.MODE_PRIVATE);
                                    if (!directory.exists()) {
                                        directory.mkdir();
                                    }
                                    File mypath1 = new File(directory, "backgroundimage.png");

                                    FileOutputStream fos = new FileOutputStream(mypath1);
                                    bitmap_backgroundImage.compress(Bitmap.CompressFormat.PNG, 100, fos);
                                    fos.close();

                                } catch (Exception e1) {
                                    Log.e("SAVE_IMAGE", e1.getMessage(), e1);
                                }
                            } else {

                            }
                        }
                    });
并将其设置为其他类似活动的背景:

public void setMainImage(){

try{
    ContextWrapper cw = new ContextWrapper(getApplicationContext());
    File directory = cw.getDir("menuimage", Context.MODE_PRIVATE);
    File mypath = new File(directory, "menuimage.png");
    Bitmap mainimage = BitmapFactory.decodeFile(mypath.getAbsolutePath());
    ImageView main = (ImageView) findViewById(R.id.imageView_main);
    main.setImageBitmap(mainimage);
    main.setScaleType(ImageView.ScaleType.CENTER_CROP);
}  catch (Exception e) {
        e.printStackTrace();
    }

}
所以我的问题是:在我只将图像设置为imageView的情况下,是否可以将图像设置为带有相同代码的图像的数组

如果我能做到,请告诉我怎么做。如果可能的话,我会提供更多的细节——我对java非常陌生。
谢谢

看到这个了吗?我用壁画画的