Gridview - Click image to view image in Viewpager

前端 未结 4 1161
慢半拍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:09

    First of all you have to implement ImageAdapter class' method getItem(int position) to return the item at "position" in MyArr. Next, in click listener, you can do something like

    HashMap selected = (HashMap) gridView.getItemAtPosition(position);
    

    With selected you have your bitmap.

提交回复
热议问题