今天换个手机进行兼容性测试,遇到了如下问题:

android.util.AndroidRuntimeException: Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?

Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK

定位显示是在Adapter调用数据过程中出现了问题:

Calling startActivity() from outside of an Activity  context requires the FLAG_ACTIVITY_NEW_TASK

加一行下列代码,便可解决:

intent1.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

相关文章:

  • 2021-08-15
  • 2021-10-17
  • 2021-05-20
  • 2021-08-15
  • 2022-12-23
  • 2021-08-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-08-15
  • 2021-08-15
  • 2021-08-15
  • 2021-08-15
  • 2021-08-15
  • 2021-07-15
相关资源
相似解决方案