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

Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. #215

Closed
1 of 3 tasks
madc0w opened this issue Feb 8, 2019 · 4 comments

Comments

@madc0w
Copy link

madc0w commented Feb 8, 2019

I'm submitting a ... (check one with "x"):

  • bug report
  • feature request
  • documentation issue

Bug report

Current behavior:

On Android, call to
launchnavigator.navigate([49.6087477, 6.136253200000056], function() { console.log("launchnavigator success"); }, function(err) { console.error("launchnavigator failed", err); }, {});

results in the error callback being called. Error message is:

Exception occurred: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

when debug is enabled, console output is:

LaunchNavigatorPlugin: Plugin action=availableApps
VM401:1 LaunchNavigatorPlugin: Plugin action=navigate
VM402:1 LaunchNavigator: Called navigate() with params; app=google_maps; dType=pos; dest=[49.6087477,6.136253200000056]; destNickname=null; sType=none; start=null; startNickname=null; transportMode=null; launchMode=maps; extras=null
VM403:1 LaunchNavigator: Using Google Maps to navigate to 49.6087477,6.136253200000056 from current location in maps mode
VM404:1 LaunchNavigator: URI: http://maps.google.com/maps?daddr=49.6087477,6.136253200000056
VM405:1 LaunchNavigatorPlugin: Exception occurred: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

Expected behavior:

Open navigation app selection dialog

Steps to reproduce:

execute the above code from console

Environment information

uk.co.workingedge.phonegap.plugin.launchnavigator version 5.0.2

Meteor 1.8.0.1
running Cordova app on device
Android 6.0.1

@nprail
Copy link

nprail commented Feb 9, 2019

I'm having this same issue.

  • cordova-android: 6.4.0
  • Android: 9
  • uk.co.workingedge.phonegap.plugin.launchnavigator: 5.0.2

@dpa99c
Copy link
Owner

dpa99c commented Feb 9, 2019

Ok, I'll patch across the fix for
dpa99c/react-native-launch-navigator#1 when I get a minute

@T3chTobi
Copy link

T3chTobi commented Feb 11, 2019

Same issue, I use it without react, is there a solution too?

Android 4.4.2

@dpa99c dpa99c closed this as completed in 33160f0 Feb 11, 2019
@dpa99c
Copy link
Owner

dpa99c commented Feb 11, 2019

Published in 5.0.3 which is now latest version on npm: https://www.npmjs.com/package/uk.co.workingedge.phonegap.plugin.launchnavigator

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

No branches or pull requests

4 participants