ggband
   /**
     * 只分享图片
     *
     * @param bitmap bitmap
     */
    private void sharedImage(Bitmap bitmap) {

        RxPermissions rxPermissions = new RxPermissions((Activity) context);
        rxPermissions.request(Manifest.permission.WRITE_EXTERNAL_STORAGE).subscribe(granted -> {

            if (granted) {
                String imgPath = initImagePath(bitmap);
                if (imgPath == null) return;
                Platform.ShareParams sp = new Platform.ShareParams();
                sp.setTitle(null);
                sp.setText(null);
                sp.setImagePath(imgPath);
                sp.setShareType(Platform.SHARE_IMAGE);//设置分享为图片类型
                Platform platform = ShareSDK.getPlatform(plantName);// 要分享的平台//QQ.NAME
                platform.setPlatformActionListener(mPlatformActionListener); // 设置分享事件回调
                // 执行图文分享
                platform.share(sp);
            } else {
                //用户拒绝的权限
            }

        });


    }

  

分类:

技术点:

相关文章:

  • 2021-12-03
  • 2021-10-04
  • 2021-04-23
  • 2021-11-07
  • 2022-12-23
  • 2021-12-29
猜你喜欢
  • 2021-08-05
  • 2021-11-29
  • 2021-12-03
  • 2021-12-13
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案