美文网首页
android 友盟QQ分享失败

android 友盟QQ分享失败

作者: charles_14ff | 来源:发表于2017-05-24 23:35 被阅读0次

    QQ图片存储失败,请检查图片或者检查是否有读写权限

    1.设置AndroidManifest.xml


    android.permission.WRITE_EXTERNAL_STORAGE

    android.permission.READ_EXTERNAL_STORAGE

    2.没有sd卡,qq不能分享本地图片Activtiy里手动添加

    3.如果使用 targetSdkVersion 23或23以上,需要做6.0适配,手动获取WRITE_EXTERNAL_STORAGE权限,否则QQ不能进行图片分享

    private static final intREQUEST_EXTERNAL_STORAGE=1;

    private staticString[]PERMISSIONS_STORAGE= {

    Manifest.permission.READ_EXTERNAL_STORAGE,

    Manifest.permission.WRITE_EXTERNAL_STORAGE

    };

    intpermission = ActivityCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE);

    if(permission != PackageManager.PERMISSION_GRANTED) {

    // We don't have permission so prompt the user

    ActivityCompat.requestPermissions(

    this,

    PERMISSIONS_STORAGE,

    REQUEST_EXTERNAL_STORAGE

    );

    }

    相关文章

      网友评论

          本文标题:android 友盟QQ分享失败

          本文链接:https://www.haomeiwen.com/subject/zkhaxxtx.html