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.withContext(...) method so Dexter can be created using generic Context #253

Closed deinlandel closed 4 years ago

deinlandel commented 4 years ago

:pushpin: References

:tophat: What is the goal?

Allow to use generic context without the need to hold reference to an activity

:memo: How is it being implemented?

Added additional method Dexter.withContext(Context context). Method Dexter.withActivity(...) is retained for backwards compatibility.

:robot: How can it be tested?

I added test named testWithLooperAndAppContext to DexterTest. It uses application context to run the same scenario as testWithLooper

deinlandel commented 4 years ago

@Serchinastico Done!

Serchinastico commented 4 years ago

There is a failing style check in Travis but I'll merge it and solve it in master directly. Thanks for your contribution!