TedPermission icon indicating copy to clipboard operation
TedPermission copied to clipboard

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

Open ilotte99 opened this issue 6 years ago • 3 comments

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

ilotte99 avatar Jul 10 '18 09:07 ilotte99

@ilotte99 Show me the your code plz.

ParkSangGwon avatar Jul 17 '18 01:07 ParkSangGwon

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)

ClarkNguyen avatar Sep 10 '18 16:09 ClarkNguyen

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

ParkSangGwon avatar Mar 21 '19 01:03 ParkSangGwon