Code Monkey home page Code Monkey logo

Comments (2)

xmuSistone avatar xmuSistone commented on May 19, 2024

是权限问题,自行修改吧;作者太懒,被项目弄的头大了; 体验Demo可用低版本手机

from animricheditor.

is1988 avatar is1988 commented on May 19, 2024

我加上了授权的方法 不过还得特意谢谢楼主的项目很实用

// android 6.0 以上版本,监听SDK权限请求,弹出对应请求框。
if (Build.VERSION.SDK_INT >= 23) {
    RongIM.getInstance().setRequestPermissionListener(new RongIM.RequestPermissionsListener() {
        @Override
        public void onPermissionRequest(String[] permissions, final int requestCode) {
            for (final String permission : permissions) {
                if (shouldShowRequestPermissionRationale(permission)) {
                    requestPermissions(new String[] {permission}, requestCode);
                } else {
                    int isPermissionGranted = checkSelfPermission(permission);
                    if (isPermissionGranted != PackageManager.PERMISSION_GRANTED) {
                        new AlertDialog.Builder(ConversationActivity.this)
                        .setMessage("你需要在设置里打开以下权限:" + permission)
                        .setPositiveButton("确认", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                requestPermissions(new String[] {permission}, requestCode);
                            }
                        })
                        .setNegativeButton("取消", null)
                        .create().show();
                    }
                    return;
                }
            }
        }
    });
}

from animricheditor.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.