在Android P Behavior Changes看到以下改动
FLAG_ACTIVITY_NEW_TASK requirement is now enforced
With Android P, you cannot start an activity from a non-activity context unless you pass the intent flag FLAG_ACTIVITY_NEW_TASK. If you attempt to start an activity without passing this flag, the activity does not start, and the system prints a message to the log.Note: The flag requirement has always been the intended behavior, and was enforced before Android N. A bug in Android N temporarily kept the flag requirement from being enforced.
我想问一下,是什么bug导致Android N中阻止强制在非Activity Context中启动activity中加FLAG_ACTIVITY_NEW_TASK?
似乎目前只找到修改源,知道bug id,但是不知道如何由此找出详细的bug。
再追加:疑似问题链接,但是我查看时访问被拒绝。
按我的理解:
在AndroidN前 如果你的Context 不是Activity 并且没有使用FLAG_ACTIVITY_NEW_TASK ,则 会禁止启动,并向系统输出日志
而Android N中 这个FLAG没有生效,导致了与预期不同的结果,而目前修复了这个bug