天天看點

關于activity launchMode設定為singleTop時,不會調用OnNewIntent的問題

當activity launchMode設定為singleTop時,用startActivity(intent)有時候不會調用OnNewIntent。這個時候請保證配置檔案xml設定launchMode=singleTop,并且代碼裡設定intent.setFlags(intent.FLAG_ACTIVITY_SINGLETOP);

問題請參閱: 點選打開連結 

如果還不會調用OnNewIntent,可以嘗試設定

intent.setAction(Long.toString(System.currentTimeMillis()));

請參閱:點選打開連結

FYI