推 milochen:PrintJ 的 Log 應該有出來吧 ? 不曉得是不是卡在回圈吶? 07/02 18:21
推 tomap41017:Service會有時間限制喔!!可能ANR了 07/02 20:22
→ tomap41017:要知道Service還是在UIThread run的 07/02 20:22
→ tomap41017:除非使用IntentService 07/02 20:22
→ infoer:to milochen:PrintJ是有印出來,但是印完迴圈跑完就沒了.. 07/03 10:24
→ infoer:to tomap41017:可是這時候我的service不是還在run嗎?? 07/03 10:25
→ infoer:這邊有說到 triggers ANR 可是那時候我還沒有SEND出去 07/03 10:27
→ infoer:應該不算十秒內還沒做完吧?? 還是我理解錯誤了?? 謝謝!! 07/03 10:28
推 milochen:所以你的意思是指PrintJ上可以看到印出 1000000 07/03 23:13
推 milochen:但後來就什麼Log也看不到了,對嗎 ? 07/03 23:14
推 milochen:如果是這樣子的話,或許有機會是因為超過Logcat的極限 07/03 23:16
推 milochen:或許可以改成這樣子 ... 看看能不能看到send ok的log 07/03 23:16
推 milochen:for(int i=0; i<=1000000; i++){ 07/03 23:16
推 milochen: if(i % 100000 == 0) { 07/03 23:16
推 milochen: String j = Integer.toString(i); 07/03 23:17
推 milochen: Log.d("printJ",j); 07/03 23:17
推 milochen: } 07/03 23:17
推 milochen:} 07/03 23:17
→ infoer:謝謝m大的回應 我改成for(int i=1;i<=任意;i++){...} 07/04 11:46
→ infoer:這樣printJ都可以印出來,但是我下面的sendbroadcast卻壞了 07/04 11:47
→ infoer:notification出不來,但如果改成i<=30000以下 卻可以出來 07/04 11:48
→ infoer:請問迴圈裡的i為什麼會把我的broadcast搞壞阿?? 謝謝指教!! 07/04 11:49
推 milochen:我沒有這樣子寫過,不過真的太神奇了。你有現成sample嗎 07/04 13:23