android process is bad,android - "process is bad" for AlarmManager launched Intent - Stack Overflow

I have a task that needs to run frequently on an Android device. I run the following code on boot:

am = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE);

pollIntent = new Intent(context,PollTask.class);

pollPendingIntent = PendingIntent.getBroadcast(context, 0, pollIntent, 0);

am.setRepeating(AlarmManager.RTC_WAKEUP,

System.currentTimeMillis(), 1000*15, pollPendingIntent);

Please don't nag me about battery use, this is for a custom embedded application, so it's not an issue.

What is an issue is that this task stops running frequently after a certain amount of time. I started viewing the logcat and noticed that every 15 seconds, after it stopped working, I would get an error saying that the intent could not be launched and that the "process is bad." At this point, I was using a separate process with the code

android:process=":remote"

in the Android Manifest for the PollTask broadcast receiver.

I removed this bit of the code, so that I'm now just running the broadcast receiver on the default thread. It seems to be working, but I'd be more satisfied if I knew what the exact issue was. Unfortunately, the error message that I mentioned before was not at all verbose. I'm still testing this on a couple of devices right now, to see how long it'll run continuously.

What do I need to know about this error? Is there any downside to using the same process?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值