Comments (11)
The crash was introduced with 88d83bb where I moved code from onDestroy
to onStop
.
Quick solution is to move the client code in onStart
rather than onCreate
but I dislike the idea. Too bad we can't rely on onDestroy
, since this is the only method in the lifecycle where it is certain that onCreate
will be invoked on back. With onStop
, it can be onCreate
or onStart
, it depends... Android lifecycle is really a fucking disaster, so tired of fighting against it for years...
I try to find an other fix.
from rxpermissions.
Is it really important to do
mSubjects.clear();
in the onShadowActivityStop()
? If the activity dies, this list will be just dropped with it, otherwise, if the activity survives and continues its lifecycle, we need this list untouched (bug is actually caused by its emptiness after onStop()).
I removed it and checked the main cases, everything works as expected.
from rxpermissions.
Yes it's important for a feature that begin to annoy me : multiple request handling.
But I'm going to take my axe, remove that feature and at the same time some complicated code. I don't think people uses it. Even me I'm not using it any more.
from rxpermissions.
I am using it :) We are requesting android.permission.CAMERA and android.permission.RECORD_AUDIO at the same point.
Aha, I see - there is a case, when I request two permissions simultaneously, DNKA on, I press "Allow" on the first dialog, then fold the app up, retrieve it back, press "Allow" on the second dialog. Without this line of code, result would not be delivered.
In the current implementation of the library, however, it produces the same crash as in the description of the issue.
I'll look for some ways to handle it.
from rxpermissions.
I'm not talking about multiple requests when you provide 2 or more parameters, I'm talking about multiple requests done at the same time for the same permission in 2 different places of your code.
So, do you really use that feature ?
from rxpermissions.
That one no (and, honestly speaking, I can hardly imagine a case when it could be inevitably needed).
from rxpermissions.
I can hardly imagine a case when it could be inevitably needed
I agree, I was probably drunk when I decided to handle that.
I pushed a fix to master, could you check if it's ok (also if possible the last test you made about multiple permissions request ?)
Thanks in advance!
from rxpermissions.
Checked - no crash now, with one permission it works as expected.
For two permissions, requested simultaneously, there is no more crash as well and all works good with DNKA off. With DNKA on, there stays the case when result is not delivered ("Allow" on the first dialog, fold up, retrieve, "Allow" on the second dialog). But I suppose it to be extremely rare, probably not worth wasting time.
Also checked the two previous cases - none reproduces.
That's great :)
Thank you very much for the fixes and quick reaction! You helped us a lot.
from rxpermissions.
Good!
About the last issue, I tried to reproduce with sample app, by adding a second permission to the parameter list, with DNKA on, but it worked mostly as expected (mostly because the result was delivered 2 times instead of one to the subscriber, will see if I can improve that).
When you said requested simultaneously you mean by passing more than one parameter ?
from rxpermissions.
When you said requested simultaneously you mean by passing more than one parameter ?
Yes. Maybe it's somehow device-specific, I'm testing on Nexus 5, 6.0.1.
Would you please deploy a new version of the library, for us to receive updates?
from rxpermissions.
Done, new version is 0.7.0 since a feature has been removed.
from rxpermissions.
Related Issues (20)
- How does it work with Android 11? HOT 1
- bug: request permission twice, in one subscribe receive callback twice
- 点击dialog外侧,dialog也会取消,且shouldShowRequestPermissionRationale=flase HOT 3
- Migrate to Maven Central
- Typo is Readme File HOT 3
- Bug:Can not perform this action after onSaveInstanceState
- Gradle import failed HOT 8
- Need to Migrate JCenter to mavenCentral HOT 5
- Cannot access class 'io.reactivex.rxjava3.core.Observable'. Check your module classpath for missing or conflicting dependencies HOT 2
- Bug: requestEach callback do not contain each permission result HOT 3
- Memory Leak
- FragmentTransition Bug
- Crash with new navigation library HOT 3
- Removing Jetifier
- android 11 中 获取应用列表时一个神奇现象
- Bug can not import packagename library HOT 2
- compileSdk 33,pixel 手机android 13,请求权限失败 HOT 7
- 没有subscribe方法 HOT 1
- There is no method
- 楼主是不是不维护了啊,Android13更新,授权相关的要适配了 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxpermissions.