Gridview - Click image to view image in Viewpager

前端 未结 4 1148
慢半拍i
慢半拍i 2021-01-01 00:23

This is a gridview that get image from json. and it works fine. I want to click image in this gridview to show full image and can slide it. I find the solution of this probl

4条回答
  •  無奈伤痛
    2021-01-01 01:01

    is this url of your image?

    -> map.put("photo", (String) c.getString("photo"));//on your main activity
    

    try using onclick on myView

    myView.setOnClickListener(new OnClickListener() {
        @Override
        public void onClick(View v) {
            HashMap result = new HashMap();
            result = MyArr.get(position);
            Intent intent = new Intent(context, youractivitytarget.class);
            intent.putExtra("photo", (String)result.get(MainActivity.PHOTO));
            context.startActivity(intent);
        }
    });
    

    then use url to download your clicked photo again

提交回复
热议问题