Karumi / Dexter

Android library that simplifies the process of requesting permissions at runtime.
http://karumi.com
Apache License 2.0
5.23k stars 671 forks source link

Dexter changes the activity lifecycle #106

Closed ghost closed 7 years ago

ghost commented 7 years ago

Steps to reproduce

Use Dexter.checkPermission in OnItemClick.onClick. Every click will cause activity onResume called. It will cause adpater populating again and the getView state is not expected.

Version of the library

2.3.1

Serchinastico commented 7 years ago

Hi @JackLauu

I highly recommend you to start using Dexter 3.x.y, the problem is that the method in Android to know if a permission has been granted or not needs an Activity instance. In 2.x.y we were creating our own Activity and that had the ugly side effect of calling the presented activity onResume method. In Dexter 3.x.y we are requiring your Activity so that we don't have to start any other activity if no permissions are being requested.

You can read more about it in issue #104 and PR #75.

Hope that makes sense and answers your question.

ghost commented 7 years ago

That's ok, thank you.