Merge "Revert "Disallow starting activities without new task from non-activity context."" into oc-dev
This commit is contained in:
@@ -847,8 +847,7 @@ class ContextImpl extends Context {
|
|||||||
// generally not allowed, except if the caller specifies the task id the activity should
|
// generally not allowed, except if the caller specifies the task id the activity should
|
||||||
// be launched in.
|
// be launched in.
|
||||||
if ((intent.getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) == 0
|
if ((intent.getFlags()&Intent.FLAG_ACTIVITY_NEW_TASK) == 0
|
||||||
&& (options == null
|
&& options != null && ActivityOptions.fromBundle(options).getLaunchTaskId() == -1) {
|
||||||
|| ActivityOptions.fromBundle(options).getLaunchTaskId() == -1)) {
|
|
||||||
throw new AndroidRuntimeException(
|
throw new AndroidRuntimeException(
|
||||||
"Calling startActivity() from outside of an Activity "
|
"Calling startActivity() from outside of an Activity "
|
||||||
+ " context requires the FLAG_ACTIVITY_NEW_TASK flag."
|
+ " context requires the FLAG_ACTIVITY_NEW_TASK flag."
|
||||||
|
|||||||
Reference in New Issue
Block a user