Gridview - Click image to view image in Viewpager

前端 未结 4 1165
慢半拍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 00:58

    See this class you can find

    GridView gridView = (GridView) findViewById(R.id.gridview);
            gridView.setAdapter(new ImageAdapter());
            gridView.setOnItemClickListener(new OnItemClickListener() {
                @Override
                public void onItemClick(AdapterView parent, View view,
                        int position, long id) {
                    startImageGalleryActivity(position);
                }
            });
    

    Here you will get same output what you wants.

    You can also download complete source code here

提交回复
热议问题