Skip to content
This repository has been archived by the owner on Jul 2, 2021. It is now read-only.

Crash when initializing Dexter 3.0.0 with a non-activity context #76

Closed
6bangs opened this issue Jul 14, 2016 · 4 comments
Closed

Crash when initializing Dexter 3.0.0 with a non-activity context #76

6bangs opened this issue Jul 14, 2016 · 4 comments
Assignees

Comments

@6bangs
Copy link

6bangs commented Jul 14, 2016

The transparent activity is no longer started with FLAG_ACTIVITY_NEW_TASK, which results in the following crash:

android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?
    at android.app.ContextImpl.startActivity(ContextImpl.java:672)
    at android.app.ContextImpl.startActivity(ContextImpl.java:659)
    at android.content.ContextWrapper.startActivity(ContextWrapper.java:331)
    at com.karumi.dexter.DexterInstance.startTransparentActivityIfNeeded(DexterInstance.java:216)
    at com.karumi.dexter.DexterInstance.checkMultiplePermissions(DexterInstance.java:322)
    at com.karumi.dexter.DexterInstance.checkSinglePermission(DexterInstance.java:294)
    at com.karumi.dexter.DexterInstance.checkPermission(DexterInstance.java:80)
    at com.karumi.dexter.Dexter.checkPermission(Dexter.java:90)

I know 3.0.0 isn't released yet; just wanted to bring it to your attention in case it wasn't known.

@pedrovgs pedrovgs self-assigned this Jul 16, 2016
@pedrovgs
Copy link
Contributor

Hi @6bangs thanks for the feedback!!

I completely forgot that we've deprecated the method to initialize Dexter using the application context. I'm going to fix it before the release.

Thanks!

@pedrovgs
Copy link
Contributor

Already in review :) Thanks for your feedbak!

@6bangs
Copy link
Author

6bangs commented Jul 17, 2016

Awesome!

@Serchinastico
Copy link
Contributor

This should be fixed in v3.0.0

Thanks for reporting and fixing it that fast guys! You rock

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants