如何对singleInstance的Activity多次传入Intent
传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);
}
protected void onNewIntent(Intent intent) {
// TODO Auto-generated method stub
super.onNewIntent(intent);
setIntent(intent);
}