[問題] service內使用notification問題
大家好,我想請問
我寫了一個sendBroadcast在service的thread內
大致是這樣
Intent alert = new Intent(NO_TI);
sendBroadcast(alert);
Log.d("send","ok");
關於broadcastReceiver也是寫在service內
broadcastReceiver裡面我寫了notification
執行之後在手機上這個版本是可以跑的
(也就是NOTIFICATION會跳出來,Log.d("send","ok")也會有)
但是如果改成
for(int i=0; i<=1000000; i++){
String j = Integer.toString(i);
Log.d("printJ",j);
}
Intent alert = new Intent(NO_TI)
sendBroadcast(alert);
Log.d("send","ok");
這樣執行不僅notification出不來,連send,ok的log也出不來
但是i如果夠小例如
for(int i=0; i<=50; i++){...}
這樣就又可以了
請問這樣有可能是什麼問題呢??
謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.74.107
推
07/02 18:21, , 1F
07/02 18:21, 1F
推
07/02 20:22, , 2F
07/02 20:22, 2F
→
07/02 20:22, , 3F
07/02 20:22, 3F
→
07/02 20:22, , 4F
07/02 20:22, 4F
→
07/03 10:24, , 5F
07/03 10:24, 5F
→
07/03 10:25, , 6F
07/03 10:25, 6F
→
07/03 10:27, , 7F
07/03 10:27, 7F
→
07/03 10:27, , 8F
07/03 10:27, 8F
→
07/03 10:28, , 9F
07/03 10:28, 9F
推
07/03 23:13, , 10F
07/03 23:13, 10F
推
07/03 23:14, , 11F
07/03 23:14, 11F
推
07/03 23:16, , 12F
07/03 23:16, 12F
推
07/03 23:16, , 13F
07/03 23:16, 13F
推
07/03 23:16, , 14F
07/03 23:16, 14F
推
07/03 23:16, , 15F
07/03 23:16, 15F
推
07/03 23:17, , 16F
07/03 23:17, 16F
推
07/03 23:17, , 17F
07/03 23:17, 17F
推
07/03 23:17, , 18F
07/03 23:17, 18F
推
07/03 23:17, , 19F
07/03 23:17, 19F
→
07/04 11:46, , 20F
07/04 11:46, 20F
→
07/04 11:47, , 21F
07/04 11:47, 21F
→
07/04 11:48, , 22F
07/04 11:48, 22F
→
07/04 11:49, , 23F
07/04 11:49, 23F
推
07/04 13:23, , 24F
07/04 13:23, 24F
AndroidDev 近期熱門文章
PTT數位生活區 即時熱門文章