nfc 刷卡呼叫onnewIntent會自動啟動自己打開一個新的activity 我不想讓他打開新的activity 四種模式我都試過 都不行有什么解決辦法嗎 在別人給的demo 里都沒事 不知道我一直到我的專案里 就有這問題 誰知道啊 在線等 拜托
@Override
protected void onNewIntent(Intent intent) {
if (nfcReadCardHelper.isNFC(intent)) {
if (nfcTask == null) {
Log.e("MainActivity", "回傳的intent可用");
nfcTask = new NFCReadTask(intent).executeOnExecutor(Executors
.newCachedThreadPool());
}
} else {
Log.e("MainActivity", "回傳的intent不可用");
}
}
uj5u.com熱心網友回復:
android:launchMode="singleInstance"uj5u.com熱心網友回復:
設定成android:launchMode="singleTop",就可以不重復打開界面,就能讀取資料轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/69840.html
標籤:移動支付
