在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/Java  Android/ 是什么bug使Android N不強(qiáng)制要求使用FLAG_ACTIVITY_NEW

是什么bug使Android N不強(qiáng)制要求使用FLAG_ACTIVITY_NEW_TASK?

Android P Behavior Changes看到以下改動(dòng)

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.

我想問(wèn)一下,是什么bug導(dǎo)致Android N中阻止強(qiáng)制在非Activity Context中啟動(dòng)activity中加FLAG_ACTIVITY_NEW_TASK?

似乎目前只找到修改源,知道bug id,但是不知道如何由此找出詳細(xì)的bug。

再追加:疑似問(wèn)題鏈接,但是我查看時(shí)訪問(wèn)被拒絕。

回答
編輯回答
蝶戀花

按我的理解:

在AndroidN前 如果你的Context 不是Activity 并且沒(méi)有使用FLAG_ACTIVITY_NEW_TASK ,則 會(huì)禁止啟動(dòng),并向系統(tǒng)輸出日志

而Android N中 這個(gè)FLAG沒(méi)有生效,導(dǎo)致了與預(yù)期不同的結(jié)果,而目前修復(fù)了這個(gè)bug

2018年9月6日 22:29