-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Question about "Must be done during an initialization phase like onCreate" #69
Comments
You don't need to get the instance of RxPermission during an init phase, it's required when you invoke methods from that instance. |
So basically when calling |
Main point is not that your activity should be visible, but that you have to invoke these methods during initialization phase (i.e. onCreate()/onStart() in Activity, etc.) For example, if you call request() and subscribe to observable in OnClickListener of some button. But if you subscribe to observable during init phase, then in case of activity recreation, you'll resubscribe, and receive result from observable. |
Alright that makes it clear. Maybe this should be added to the README. |
That requirement is due to the permission request dialog, which is displayed by the framework when you call The only solution is so to invoke the That requirement is clearly the ugliest thing in that library, and there is a long thread about that in #3, but despite the intervention of famous android developers, no better solution could be found. |
From my side this issue could be closed. It's up to you whether you want to update the javadoc and README or not. |
I linked this issue in the readme. |
The sample app has the subscription in |
Permission dialog opened twice when calling method |
After the first call of the Call_Phone cell phone Note2, the application exit |
@tbruyelle I am evaluating using this library on my App, but this "only use it in My app gets the user location only after there's a user click on a button, so the Also, even if I could get the permission in How do you guys deal with this so common scenarios? Am I missing something? |
@feinstei our team have got no problems with such scenarios. The only thing you should keep in mind it's |
Is it okay to use onPostCreate? |
BUG 主体布局使用vierpager2+Fragment出现错误 java.lang.IllegalStateException: FragmentManager is already executing transactions 该如何解决? |
FWIW I can reproduce this even if the system decides to not show the system permission dialog. (i.e. Android OS is still pausing my Activity, and thus Fragment, every time I request permission. Following advice in the readme fixed the problem |
Why do I need to get the instance of RxPermission in a phase like
onCreate
? Since internally it uses the ApplicationContext isn't the activity lifecycle irrelevant?The text was updated successfully, but these errors were encountered: