My android service is working fine on some devices. On other devices, it's show running in "Running Applications" but it's not working and it's taking up 0 mb RAM. I have tried this solution too.
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
IntentFilter screenStateFilter = new IntentFilter();
screenStateFilter.addAction(Intent.ACTION_TIME_TICK);
//Toast.makeText(getApplicationContext(),"start",Toast.LENGTH_LONG).show();
registerReceiver(timeTickReceiver, screenStateFilter);
super.onStartCommand(intent, flags, startId);
//return super.onStartCommand(intent, flags, startId);
return Service.START_REDELIVER_INTENT;
}
Please tell me how can I fix this
public int onStartCommand(Intent intent, int flags, int startId) {
IntentFilter screenStateFilter = new IntentFilter();
screenStateFilter.addAction(Intent.ACTION_TIME_TICK);
//Toast.makeText(getApplicationContext(),"start",Toast.LENGTH_LONG).show();
registerReceiver(timeTickReceiver, screenStateFilter);
// try removing this line commented below
// super.onStartCommand(intent, flags, startId);
//return super.onStartCommand(intent, flags, startId);
return Service.START_REDELIVER_INTENT;
}
check my comment
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.