Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AndroidRuntimeException: Calling startActivity() #42

Closed
praveenbbhati opened this issue May 21, 2020 · 5 comments
Closed

AndroidRuntimeException: Calling startActivity() #42

praveenbbhati opened this issue May 21, 2020 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@praveenbbhati
Copy link

Hi,

I'm using this library via a flutter plugin.

Device: OnePlus 7 GM1901
OS: Oxygen OS 10.3.2GM57AA

it returns true for isAutoStartPermissionAvailable

any help is appreciated.

Logs :
W/System.err(28183): android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want? W/System.err(28183): at android.app.ContextImpl.startActivity(ContextImpl.java:964) W/System.err(28183): at android.app.ContextImpl.startActivity(ContextImpl.java:940) W/System.err(28183): at android.content.ContextWrapper.startActivity(ContextWrapper.java:383) W/System.err(28183): at com.judemanutd.autostarter.AutoStartPermissionHelper.startIntent(AutoStartPermissionHelper.kt:325) W/System.err(28183): at com.judemanutd.autostarter.AutoStartPermissionHelper.autoStartOnePlus(AutoStartPermissionHelper.kt:308) W/System.err(28183): at com.judemanutd.autostarter.AutoStartPermissionHelper.getAutoStartPermission(AutoStartPermissionHelper.kt:118) W/System.err(28183): at com.yin.autostart.AutostartPlugin.onMethodCall(AutostartPlugin.java:53)

@praveenbbhati praveenbbhati changed the title AndroidRuntimeExcetion: Calling startActivity() AndroidRuntimeException: Calling startActivity() May 21, 2020
@minuhariharan
Copy link

I am also facing the same issue and unable to use this plugin, what is the fix for this? I am getting this issue for getAutoStartPermission() for One Plus, Redmi

@judemanutd judemanutd added bug Something isn't working help wanted Extra attention is needed labels Jun 29, 2020
@judemanutd
Copy link
Owner

@minuhariharan could you take a look at the steps mentioned in #47 (comment) and post the results here once you have them, this should allow for better debugging.

@agent10
Copy link

agent10 commented Apr 9, 2021

The same thing. I'm calling getAutoStartPermission() from foreground service and it cannot be done without FLAG_ACTIVITY_NEW_TASK for intent

@judemanutd
Copy link
Owner

@agent10 I think #62 might resolve your issue here, I'm waiting on a slight modification to the PR after which I can accept the change

@judemanutd
Copy link
Owner

This should be resolved by #69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants