intentservice - Prevent Android "process is bad" error -
the process bad error not seem documented, , have been able find workarounds. instead interested in cause of error , how prevent happening, , not how manually handle through rebooting, relaunching app, etc.
my particular application uses alarmmanager launch intentservice runs ~10s every ~30s. called on creation of application:
intent serviceintent = new intent(appcontext, myservice.class); serviceintent.putextra("service_extra", extra); launchservice = pendingintent.getservice( appcontext, launch_service_request_code, scanintent, pendingintent.flag_update_current ); alarmmanager.setinexactrepeating( alarmmanager.rtc, system.currenttimemillis() + interval, interval, launchservice );
this works expected of time. however, service fail launch indefinite period, hours @ time. next error seen every ~30s, know alarms attempting launch intentservice scheduled, effort fails process bad error.
unable launch app com.example.android/10024 service intent { cmp=com.example.android/.myservice (has extras) }: process bad
this fixed reopening app. need know how prevent it! purpose of service run in background while activities stopped or destroyed, must prevent error without user interaction or workaround.
android intentservice
No comments:
Post a Comment