RxPermissions
RxPermissions copied to clipboard
# java.lang.IllegalStateException:Activity has been destroyed
#102 java.lang.IllegalStateException Activity has been destroyed com.tbruyelle.rxpermissions2.RxPermissions.getRxPermissionsFragment(RxPermissions.java:53)
any help on this?
Provide more info with full code snippet (to see how and when you call RxPermissions methods), please. Also, if you want to get help you better provide some more description how we could reproduce this issue, device info etc.
You know, I think this issue appears when you rotating activity but somewhere reference to previous is saved and with this reference you try to get RxPermission...
Provide more info with full code snippet (to see how and when you call RxPermissions methods), please. Also, if you want to get help you better provide some more description how we could reproduce this issue, device info etc.
You know, I think this issue appears when you rotating activity but somewhere reference to previous is saved and with this reference you try to get RxPermission...
I have met the same problem in Huawei roms. Exceptions: java.lang.IllegalStateException Activity has been destroyed
This is my code :
When Activity onCreate I called:
try {
new RxPermissions(this)
.request(Manifest.permission.READ_PHONE_STATE)
.subscribe(new Consumer<Boolean>() {
@Override
public void accept(Boolean aBoolean) throws Exception {
//do something
}
});
} catch (Exception e) {
//huawei emui maybe crash
//do something
}
It seems the activity has been onDestroy and onCreate at once. rxpermissions:0.9.5@aar