【发布时间】:2018-02-23 06:37:45
【问题描述】:
在小米手机中,当我尝试使用以下代码通过点击通知重定向到浏览器时:
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
try {
context.startActivity(intent);
} catch (ActivityNotFoundException e) {
Log.e(TAG, e.getMessage());
}
重定向不起作用,它抛出一个错误“从 Activity 上下文之外调用 startActivity() 需要
FLAG_ACTIVITY_NEW_TASK 标志。这真的是你想要的吗?”。
我是
在其他手机上运行良好。谁能帮忙解决这个问题?
【问题讨论】:
标签: android android-intent push-notification android-notifications