传Intent数据给Activity时,此Activity为singleInstance ,在onResume中无法获取传入的Intent,原来用getIntent()只能获取Activity原来的Intent.

有此方法可以让singleInstance的Activity获取传入的Intent,并获取Extra数据:

重载:onNewIntent(Intent intent)

 

 

@Override
    protected void onNewIntent(Intent intent) {
        // TODO Auto-generated method stub
        super.onNewIntent(intent);
        setIntent(intent);
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-03-09
  • 2021-06-06
  • 2021-12-21
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-03
  • 2022-03-05
  • 2021-05-26
相关资源
相似解决方案