shareSdk分享图片


   /**
     * 只分享图片
     *
     * @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 {
                //用户拒绝的权限
            }

        });


    }

  


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM