GalleryAdapter class
public class GalleryAdapter extends RecyclerView.Adapter<GalleryAdapter.ViewHolder> {
    private Context context;
    private List<String> images;
    protected PhotoListener photoListener;
    public GalleryAdapter(Context context, List<String> images, PhotoListener photoListener) {
        this.context = context;
        this.images = images;
        this.photoListener = photoListener;
    }
    @NonNull
    @Override
    public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new ViewHolder(
                LayoutInflater.from(context).inflate(R.layout.gallery_item, parent, false)
        );
    }
    @Override
    public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
        String image = images.get(position);
        int pos = position;
        Glide.with(context).load(image).into(holder.image);
        holder.itemView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                photoListener.onPhotoClick(image, pos);
            }
        });
    }
    @Override
    public int getItemCount() {
        return images.size();
    }
    public class ViewHolder extends RecyclerView.ViewHolder {
        ImageView image;
        public ViewHolder(@NonNull View itemView) {
            super(itemView);
            image = itemView.findViewById(R.id.image);
        }
    }
    public interface PhotoListener {
        void onPhotoClick(String path, int position);
    }
}
My List images is the list of query absolute path of image in android studio My screen to show image is viewpager. I want to share an image when I click the share button. But I don't know how to do that. It doesn't have a lot of docs about share viewpager. Please help me
 
                        
You must be implementing the PhotoListener in your Activity or Fragment where you are showing this view-pager and passing the same listener to your adapter's constructor somewhat like below:
}
Using above implementation, you can compose the photo-sharing intent as mentioned here: How to use "Share image using" sharing Intent to share images in android?