在android中Activity设置了singleXX模式之后,需要使用onNewIntent来接收其他Activity,广播,notification等传来的intent,要注意的是,在onNewIntent中要使用
setIntent(intent) 去更新onNewIntent,然后getIntent()才能得到最新的intent值
@Override
protected void onNewIntent(Intent intent) {
// TODO Auto-generated method stub
Log.i(TAG, "new intent------->" + intent.toString()+intent.getAction());
super.onNewIntent(intent);
setIntent(intent);
intent = getIntent();
if(intent.getAction() != null && intent.getAction().equalsIgnoreCase("OPEN_NOTICE_LIST")) {
}
}