I´m running a demo app in Android 23 (emulator and device) and when I call the function and grant phone permission, an exception is thrown. This is the log from logcat (I added exception message in error callback)
08-25 20:58:33.380 16353-16353/com.example.hola D/CordovaActivity: Paused the activity.
08-25 20:58:34.799 16353-16353/com.example.hola W/CordovaPlugin: Attempted to send a second callback for ID: CordovaCall692644862
Result was: "Call Failed: Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?"
08-25 20:58:34.799 16353-16353/com.example.hola D/CordovaActivity: Resumed the activity.
If I set that flag before this.cordova.getActivity().getApplicationContext().startActivity(intent);
it works, but the calling UI is set in foreground. Is this normal behaviour?
I´m running a demo app in Android 23 (emulator and device) and when I call the function and grant phone permission, an exception is thrown. This is the log from logcat (I added exception message in error callback)
If I set that flag before
this.cordova.getActivity().getApplicationContext().startActivity(intent);
it works, but the calling UI is set in foreground. Is this normal behaviour?My cordova code inside a button callback: