Note that if this method is being called from outside of an Activity Context, then the Intent must include the FLAG_ACTIVITY_NEW_TASK launch flag. This is because, without being started from an existing Activity, there is no existing task in which to place the new activity and thus it needs to be placed in its own separate task.
flag:FLAG_ACTIVITY_NEW_TASK
,才能启动成功。比如通过Application的context打开activity。 这是因为,启动activity需要一个依附的task,使用非activity的context是没有task的,只能告诉它去启动一个task。