Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ilotte99 opened this issue Jul 10, 2018 · 3 comments

Comments

@ilotte99
Copy link

ilotte99 commented Jul 10, 2018

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
Copy link
Owner

@ilotte99 Show me the your code plz.

@ClarkNguyen
Copy link

ClarkNguyen commented Sep 10, 2018

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants