خرید بک لینک

Vote count: 0

I have an activity where an AsyncTask downloads from Google Places Photos an ArrayList<Bitmap> of photos. In this Activity I was able to show them in a GridView.

Now, when a user clicks in one image, a new Activity (or Fragment?) should be created, showing the clicked image in fullscreen with a swipe function, always in fullscreen.

I think I can do that by passing the entire ArrayList<Bitmap> and the position of the clicked image to my second Activity, but it could be quite inefficient.

My second thought was to use LruCache, but I honestly don't know how to use it.

Could you suggest some other, more efficient way to do what I want or explain me how to use LruCache for my specific problem?

My AsyncTask code should be enough:

class LoadPhoto extends AsyncTask <ArrayList<String>,Bitmap,Bitmap> {

    @Override
    protected Bitmap doInBackground(ArrayList<String>... params) {
        ArrayList<String> list_photos= new ArrayList<>();
        list_photos= params[0];
        GooglePlaces googlePlaces = new GooglePlaces();
        for (String p: list_photos){
            Bitmap bmp= googlePlaces.getPhoto(p);
            bitmapList.add(bmp);
        }
        retu null;
    }

    @Override
    protected void onPostExecute(Bitmap bitmap) {
        pd.dismiss();
        gd.setAdapter(new ImageAdapter(ImageGrid.this,R.layout.activity_image_grid,bitmapList));
        }
    }

asked 1 min ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 15 خرداد 1395 ساعت: 18:37

صفحه بندی