ParkSangGwon / TedPermission

Easy check permission library for Android Marshmallow
1.74k stars 238 forks source link

UI become not responsive after permission get denied at Android Nougat and Oreo #93

Open ilotte99 opened 6 years ago

ilotte99 commented 6 years ago

When the permission is denied, the UI become not responsive (screen is hang) but there is no crash error. (Device using Samsung Galaxy J5 and Samsung Galaxy S8+) However this is works fine at Android Marshmallow and below.

Please help

ParkSangGwon commented 6 years ago

@ilotte99 Show me the your code plz.

ClarkNguyen commented 6 years ago

confirm this happen on Samsung S8 (OS Version: 8.0.0) make app crashed, but J5 work fine it's something like this:

Caused by java.lang.IllegalStateException Only fullscreen opaque activities can request orientation com.gun0912.tedpermission.TedPermissionActivity.onCreate (TedPermissionActivity.java:69)

This is my code

Disposable disposable = TedRx2Permission.with(mHomeActivity)
            .setPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, 
Manifest.permission.ACCESS_COARSE_LOCATION})
            .setDeniedMessage(R.string.reject_permission)
            .request()
            .subscribe(result -> {
                if (result.isGranted()) {
                    buildGoogleApiClient();
                    mMap.setMyLocationEnabled(true);
                } else {
                    if (mDestinationLatLng != null) {
                        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(mDestinationLatLng, 13));

                        CameraPosition cameraPosition = new CameraPosition.Builder()
                                .target(mDestinationLatLng)      // Sets the center of the map to location user
                                .zoom(13)                   // Sets the zoom
                                .bearing(90)                // Sets the orientation of the camera to east
                                .tilt(40)                   // Sets the tilt of the camera to 30 degrees
                                .build();                   // Creates a CameraPosition from the builder
                        mMap.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));
                    }
                    if (!mGPSDeactiveDialog.isShowing()) {
                        mGPSDeactiveDialog.show();
                    }
                }
            });
    compositeDisposable.add(disposable);

Update: this bug was gone when update to new version (2.2.2)

ParkSangGwon commented 5 years ago

@ilotte99 Did you use observeOn(), subscribeOn()?