Android background service stopped/paused on Huawei Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!when will be the service stop , when application goes in background in oreo deviceIs there a way to run Python on Android?How do save an Android Activity state using save instance state?Close/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?Stop EditText from gaining focus at Activity startupIs there a unique Android device ID?What is 'Context' on Android?Proper use cases for Android UserManager.isUserAGoat()?Activity can still call unbind service method. Is it normal?How to getAssets in a service?
Fundamental Solution of the Pell Equation
Is it cost-effective to upgrade an old-ish Giant Escape R3 commuter bike with entry-level branded parts (wheels, drivetrain)?
What is the meaning of the simile “quick as silk”?
AppleTVs create a chatty alternate WiFi network
Can you use the Shield Master feat to shove someone before you make an attack by using a Readied action?
How could we fake a moon landing now?
why is Nikon 1.4g better when Nikon 1.8g is sharper?
Do square wave exist?
Why wasn't DOSKEY integrated with COMMAND.COM?
If u is orthogonal to both v and w, and u not equal to 0, argue that u is not in the span of v and w. (
Why aren't air breathing engines used as small first stages?
How come Sam didn't become Lord of Horn Hill?
Is "Reachable Object" really an NP-complete problem?
What does this Jacques Hadamard quote mean?
Do wooden building fires get hotter than 600°C?
What's the meaning of "fortified infraction restraint"?
Circuit to "zoom in" on mV fluctuations of a DC signal?
Do jazz musicians improvise on the parent scale in addition to the chord-scales?
How to tell that you are a giant?
First console to have temporary backward compatibility
What does the "x" in "x86" represent?
How to convince students of the implication truth values?
What is implied by the word 'Desika'
For a new assistant professor in CS, how to build/manage a publication pipeline
Android background service stopped/paused on Huawei
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!when will be the service stop , when application goes in background in oreo deviceIs there a way to run Python on Android?How do save an Android Activity state using save instance state?Close/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?Stop EditText from gaining focus at Activity startupIs there a unique Android device ID?What is 'Context' on Android?Proper use cases for Android UserManager.isUserAGoat()?Activity can still call unbind service method. Is it normal?How to getAssets in a service?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have developed an Android app that has a background service that runs endlessly and saves on a local SqLite DB the results of bluetooth scan and GPS positions. Only on Huawei devices this service seems to be paused or stopped for some minutes (I noticed that after inserting some log into the code): in theese minutes any log is written.
. I tried without success to change some settings of device (battery optimization).
Do you have some advice to solve the problem?
Below you can find a snipped of the service.
public class MyService extends Service
public MyService()
super();
@Override
public void onCreate()
super.onCreate();
...
...
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
startForeground(1031, getNotification());
final Intent serviceIntent = new Intent(getApplicationContext(), MyService.class);
ServiceConnection connection = new ServiceConnection()
@Override
public void onServiceConnected(ComponentName className, IBinder service)
MyServiceBinder binder = (MyServiceBinder) service;
started = true;
@Override
public void onServiceDisconnected(ComponentName arg0)
started = false;
;
bindService(serviceIntent, connection, Context.BIND_AUTO_CREATE);
@RequiresApi(Build.VERSION_CODES.O)
private Notification getNotification()
NotificationChannel channel = new NotificationChannel("channel_01", "My Channel", NotificationManager.IMPORTANCE_DEFAULT);
NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
Notification.Builder builder = new Notification.Builder(getApplicationContext(), "channel_01");
builder.setContentTitle(getString(R.string.app_name))
.setAutoCancel(true)
.setColor(getResources().getColor(R.color.colorAccent))
.setContentText(getString(R.string.app_name))
.setSmallIcon(R.drawable.ic_stat_onesignal_default);
return builder.build();
public class MyServiceBinder extends Binder
MyService getService()
return MyService.this;
private void stopForegroundService()
// Stop foreground service and remove the notification.
stopForeground(true);
// Stop the foreground service.
stopSelf();
@Override
public void onDestroy()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
stopForegroundService();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
//Restart after 5 secs
Handler h = new Handler(Looper.getMainLooper());
h.postDelayed(new Runnable()
@Override
public void run()
GenericUtility.launchService(MyService.class, getApplication());
, 5000);
@Override
public int onStartCommand(Intent intent, int flags, int startId)
...
...
initScanLoop();
initLocationManager();
return Service.START_STICKY;
@Nullable
@Override
public IBinder onBind(Intent intent)
return new MyServiceBinder();
@Override
public boolean onUnbind(Intent intent)
boolean res = super.onUnbind(intent);
return res;
/*Init bluetooth handler*/
private void initScanLoop()
final Handler h = new Handler(Looper.getMainLooper());
h.post(new Runnable()
@Override
public void run()
scanLeDevice();
hBeacon.postDelayed(this, SCAN_DURATION + 10000);
);
private void scanLeDevice()
if(mLEScanner != null && !scanning.get() && !stopScan)
scanning.set(true);
mLEScanner.startScan(null, settings, mScanCallback);
Handler mHandler = new Handler(Looper.getMainLooper());
mHandler.postDelayed(new Runnable()
@Override
public void run()
if(scanning.get())
stopScanLeDevice();
, SCAN_DURATION);
private void stopScanLeDevice()
scanning.set(false);
if(mLEScanner != null)
mLEScanner.stopScan(mScanCallback);
/*Finish bluetooth handler*/
/*Init GPS handler*/
private void initLocationManager()
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
createLocationChangedCallback();
locationListener = new BeaconScanLocationListener(locationChangedCallback);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
private void createLocationChangedCallback()
locationChangedCallback = new LocationChangedCallback()
@Override
public void callback(final Location location)
try
//GPS callcback
catch(Exception e)
@Override
public void enabledDisabled(boolean enabled)
;
/*Finish GPS handler*/
UPDATE
I improved app functionality replacing bluetooth scanning with monitoring beacon in region function of Android Beacon Library.
java android service background huawei
|
show 2 more comments
I have developed an Android app that has a background service that runs endlessly and saves on a local SqLite DB the results of bluetooth scan and GPS positions. Only on Huawei devices this service seems to be paused or stopped for some minutes (I noticed that after inserting some log into the code): in theese minutes any log is written.
. I tried without success to change some settings of device (battery optimization).
Do you have some advice to solve the problem?
Below you can find a snipped of the service.
public class MyService extends Service
public MyService()
super();
@Override
public void onCreate()
super.onCreate();
...
...
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
startForeground(1031, getNotification());
final Intent serviceIntent = new Intent(getApplicationContext(), MyService.class);
ServiceConnection connection = new ServiceConnection()
@Override
public void onServiceConnected(ComponentName className, IBinder service)
MyServiceBinder binder = (MyServiceBinder) service;
started = true;
@Override
public void onServiceDisconnected(ComponentName arg0)
started = false;
;
bindService(serviceIntent, connection, Context.BIND_AUTO_CREATE);
@RequiresApi(Build.VERSION_CODES.O)
private Notification getNotification()
NotificationChannel channel = new NotificationChannel("channel_01", "My Channel", NotificationManager.IMPORTANCE_DEFAULT);
NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
Notification.Builder builder = new Notification.Builder(getApplicationContext(), "channel_01");
builder.setContentTitle(getString(R.string.app_name))
.setAutoCancel(true)
.setColor(getResources().getColor(R.color.colorAccent))
.setContentText(getString(R.string.app_name))
.setSmallIcon(R.drawable.ic_stat_onesignal_default);
return builder.build();
public class MyServiceBinder extends Binder
MyService getService()
return MyService.this;
private void stopForegroundService()
// Stop foreground service and remove the notification.
stopForeground(true);
// Stop the foreground service.
stopSelf();
@Override
public void onDestroy()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
stopForegroundService();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
//Restart after 5 secs
Handler h = new Handler(Looper.getMainLooper());
h.postDelayed(new Runnable()
@Override
public void run()
GenericUtility.launchService(MyService.class, getApplication());
, 5000);
@Override
public int onStartCommand(Intent intent, int flags, int startId)
...
...
initScanLoop();
initLocationManager();
return Service.START_STICKY;
@Nullable
@Override
public IBinder onBind(Intent intent)
return new MyServiceBinder();
@Override
public boolean onUnbind(Intent intent)
boolean res = super.onUnbind(intent);
return res;
/*Init bluetooth handler*/
private void initScanLoop()
final Handler h = new Handler(Looper.getMainLooper());
h.post(new Runnable()
@Override
public void run()
scanLeDevice();
hBeacon.postDelayed(this, SCAN_DURATION + 10000);
);
private void scanLeDevice()
if(mLEScanner != null && !scanning.get() && !stopScan)
scanning.set(true);
mLEScanner.startScan(null, settings, mScanCallback);
Handler mHandler = new Handler(Looper.getMainLooper());
mHandler.postDelayed(new Runnable()
@Override
public void run()
if(scanning.get())
stopScanLeDevice();
, SCAN_DURATION);
private void stopScanLeDevice()
scanning.set(false);
if(mLEScanner != null)
mLEScanner.stopScan(mScanCallback);
/*Finish bluetooth handler*/
/*Init GPS handler*/
private void initLocationManager()
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
createLocationChangedCallback();
locationListener = new BeaconScanLocationListener(locationChangedCallback);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
private void createLocationChangedCallback()
locationChangedCallback = new LocationChangedCallback()
@Override
public void callback(final Location location)
try
//GPS callcback
catch(Exception e)
@Override
public void enabledDisabled(boolean enabled)
;
/*Finish GPS handler*/
UPDATE
I improved app functionality replacing bluetooth scanning with monitoring beacon in region function of Android Beacon Library.
java android service background huawei
check this stackoverflow.com/a/54547511/9060917
– Praveen
Mar 22 at 9:54
are you using app like battery saver?
– Praveen
Mar 22 at 9:57
Have a look at this it may help dontkillmyapp.com
– Ivan Wooll
Mar 22 at 10:02
Can you use an alternative mechanism for getting this information to aService
, such as aJobScheduler
?
– PPartisan
Mar 22 at 10:12
@IvanWooll thaks for your suggest but I've tried without success
– user3363936
Mar 22 at 10:52
|
show 2 more comments
I have developed an Android app that has a background service that runs endlessly and saves on a local SqLite DB the results of bluetooth scan and GPS positions. Only on Huawei devices this service seems to be paused or stopped for some minutes (I noticed that after inserting some log into the code): in theese minutes any log is written.
. I tried without success to change some settings of device (battery optimization).
Do you have some advice to solve the problem?
Below you can find a snipped of the service.
public class MyService extends Service
public MyService()
super();
@Override
public void onCreate()
super.onCreate();
...
...
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
startForeground(1031, getNotification());
final Intent serviceIntent = new Intent(getApplicationContext(), MyService.class);
ServiceConnection connection = new ServiceConnection()
@Override
public void onServiceConnected(ComponentName className, IBinder service)
MyServiceBinder binder = (MyServiceBinder) service;
started = true;
@Override
public void onServiceDisconnected(ComponentName arg0)
started = false;
;
bindService(serviceIntent, connection, Context.BIND_AUTO_CREATE);
@RequiresApi(Build.VERSION_CODES.O)
private Notification getNotification()
NotificationChannel channel = new NotificationChannel("channel_01", "My Channel", NotificationManager.IMPORTANCE_DEFAULT);
NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
Notification.Builder builder = new Notification.Builder(getApplicationContext(), "channel_01");
builder.setContentTitle(getString(R.string.app_name))
.setAutoCancel(true)
.setColor(getResources().getColor(R.color.colorAccent))
.setContentText(getString(R.string.app_name))
.setSmallIcon(R.drawable.ic_stat_onesignal_default);
return builder.build();
public class MyServiceBinder extends Binder
MyService getService()
return MyService.this;
private void stopForegroundService()
// Stop foreground service and remove the notification.
stopForeground(true);
// Stop the foreground service.
stopSelf();
@Override
public void onDestroy()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
stopForegroundService();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
//Restart after 5 secs
Handler h = new Handler(Looper.getMainLooper());
h.postDelayed(new Runnable()
@Override
public void run()
GenericUtility.launchService(MyService.class, getApplication());
, 5000);
@Override
public int onStartCommand(Intent intent, int flags, int startId)
...
...
initScanLoop();
initLocationManager();
return Service.START_STICKY;
@Nullable
@Override
public IBinder onBind(Intent intent)
return new MyServiceBinder();
@Override
public boolean onUnbind(Intent intent)
boolean res = super.onUnbind(intent);
return res;
/*Init bluetooth handler*/
private void initScanLoop()
final Handler h = new Handler(Looper.getMainLooper());
h.post(new Runnable()
@Override
public void run()
scanLeDevice();
hBeacon.postDelayed(this, SCAN_DURATION + 10000);
);
private void scanLeDevice()
if(mLEScanner != null && !scanning.get() && !stopScan)
scanning.set(true);
mLEScanner.startScan(null, settings, mScanCallback);
Handler mHandler = new Handler(Looper.getMainLooper());
mHandler.postDelayed(new Runnable()
@Override
public void run()
if(scanning.get())
stopScanLeDevice();
, SCAN_DURATION);
private void stopScanLeDevice()
scanning.set(false);
if(mLEScanner != null)
mLEScanner.stopScan(mScanCallback);
/*Finish bluetooth handler*/
/*Init GPS handler*/
private void initLocationManager()
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
createLocationChangedCallback();
locationListener = new BeaconScanLocationListener(locationChangedCallback);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
private void createLocationChangedCallback()
locationChangedCallback = new LocationChangedCallback()
@Override
public void callback(final Location location)
try
//GPS callcback
catch(Exception e)
@Override
public void enabledDisabled(boolean enabled)
;
/*Finish GPS handler*/
UPDATE
I improved app functionality replacing bluetooth scanning with monitoring beacon in region function of Android Beacon Library.
java android service background huawei
I have developed an Android app that has a background service that runs endlessly and saves on a local SqLite DB the results of bluetooth scan and GPS positions. Only on Huawei devices this service seems to be paused or stopped for some minutes (I noticed that after inserting some log into the code): in theese minutes any log is written.
. I tried without success to change some settings of device (battery optimization).
Do you have some advice to solve the problem?
Below you can find a snipped of the service.
public class MyService extends Service
public MyService()
super();
@Override
public void onCreate()
super.onCreate();
...
...
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
startForeground(1031, getNotification());
final Intent serviceIntent = new Intent(getApplicationContext(), MyService.class);
ServiceConnection connection = new ServiceConnection()
@Override
public void onServiceConnected(ComponentName className, IBinder service)
MyServiceBinder binder = (MyServiceBinder) service;
started = true;
@Override
public void onServiceDisconnected(ComponentName arg0)
started = false;
;
bindService(serviceIntent, connection, Context.BIND_AUTO_CREATE);
@RequiresApi(Build.VERSION_CODES.O)
private Notification getNotification()
NotificationChannel channel = new NotificationChannel("channel_01", "My Channel", NotificationManager.IMPORTANCE_DEFAULT);
NotificationManager notificationManager = getSystemService(NotificationManager.class);
notificationManager.createNotificationChannel(channel);
Notification.Builder builder = new Notification.Builder(getApplicationContext(), "channel_01");
builder.setContentTitle(getString(R.string.app_name))
.setAutoCancel(true)
.setColor(getResources().getColor(R.color.colorAccent))
.setContentText(getString(R.string.app_name))
.setSmallIcon(R.drawable.ic_stat_onesignal_default);
return builder.build();
public class MyServiceBinder extends Binder
MyService getService()
return MyService.this;
private void stopForegroundService()
// Stop foreground service and remove the notification.
stopForeground(true);
// Stop the foreground service.
stopSelf();
@Override
public void onDestroy()
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
stopForegroundService();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
//Restart after 5 secs
Handler h = new Handler(Looper.getMainLooper());
h.postDelayed(new Runnable()
@Override
public void run()
GenericUtility.launchService(MyService.class, getApplication());
, 5000);
@Override
public int onStartCommand(Intent intent, int flags, int startId)
...
...
initScanLoop();
initLocationManager();
return Service.START_STICKY;
@Nullable
@Override
public IBinder onBind(Intent intent)
return new MyServiceBinder();
@Override
public boolean onUnbind(Intent intent)
boolean res = super.onUnbind(intent);
return res;
/*Init bluetooth handler*/
private void initScanLoop()
final Handler h = new Handler(Looper.getMainLooper());
h.post(new Runnable()
@Override
public void run()
scanLeDevice();
hBeacon.postDelayed(this, SCAN_DURATION + 10000);
);
private void scanLeDevice()
if(mLEScanner != null && !scanning.get() && !stopScan)
scanning.set(true);
mLEScanner.startScan(null, settings, mScanCallback);
Handler mHandler = new Handler(Looper.getMainLooper());
mHandler.postDelayed(new Runnable()
@Override
public void run()
if(scanning.get())
stopScanLeDevice();
, SCAN_DURATION);
private void stopScanLeDevice()
scanning.set(false);
if(mLEScanner != null)
mLEScanner.stopScan(mScanCallback);
/*Finish bluetooth handler*/
/*Init GPS handler*/
private void initLocationManager()
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
createLocationChangedCallback();
locationListener = new BeaconScanLocationListener(locationChangedCallback);
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);
private void createLocationChangedCallback()
locationChangedCallback = new LocationChangedCallback()
@Override
public void callback(final Location location)
try
//GPS callcback
catch(Exception e)
@Override
public void enabledDisabled(boolean enabled)
;
/*Finish GPS handler*/
UPDATE
I improved app functionality replacing bluetooth scanning with monitoring beacon in region function of Android Beacon Library.
java android service background huawei
java android service background huawei
edited Apr 12 at 8:45
user3363936
asked Mar 22 at 9:44
user3363936user3363936
1016
1016
check this stackoverflow.com/a/54547511/9060917
– Praveen
Mar 22 at 9:54
are you using app like battery saver?
– Praveen
Mar 22 at 9:57
Have a look at this it may help dontkillmyapp.com
– Ivan Wooll
Mar 22 at 10:02
Can you use an alternative mechanism for getting this information to aService
, such as aJobScheduler
?
– PPartisan
Mar 22 at 10:12
@IvanWooll thaks for your suggest but I've tried without success
– user3363936
Mar 22 at 10:52
|
show 2 more comments
check this stackoverflow.com/a/54547511/9060917
– Praveen
Mar 22 at 9:54
are you using app like battery saver?
– Praveen
Mar 22 at 9:57
Have a look at this it may help dontkillmyapp.com
– Ivan Wooll
Mar 22 at 10:02
Can you use an alternative mechanism for getting this information to aService
, such as aJobScheduler
?
– PPartisan
Mar 22 at 10:12
@IvanWooll thaks for your suggest but I've tried without success
– user3363936
Mar 22 at 10:52
check this stackoverflow.com/a/54547511/9060917
– Praveen
Mar 22 at 9:54
check this stackoverflow.com/a/54547511/9060917
– Praveen
Mar 22 at 9:54
are you using app like battery saver?
– Praveen
Mar 22 at 9:57
are you using app like battery saver?
– Praveen
Mar 22 at 9:57
Have a look at this it may help dontkillmyapp.com
– Ivan Wooll
Mar 22 at 10:02
Have a look at this it may help dontkillmyapp.com
– Ivan Wooll
Mar 22 at 10:02
Can you use an alternative mechanism for getting this information to a
Service
, such as a JobScheduler
?– PPartisan
Mar 22 at 10:12
Can you use an alternative mechanism for getting this information to a
Service
, such as a JobScheduler
?– PPartisan
Mar 22 at 10:12
@IvanWooll thaks for your suggest but I've tried without success
– user3363936
Mar 22 at 10:52
@IvanWooll thaks for your suggest but I've tried without success
– user3363936
Mar 22 at 10:52
|
show 2 more comments
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55296825%2fandroid-background-service-stopped-paused-on-huawei%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55296825%2fandroid-background-service-stopped-paused-on-huawei%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
check this stackoverflow.com/a/54547511/9060917
– Praveen
Mar 22 at 9:54
are you using app like battery saver?
– Praveen
Mar 22 at 9:57
Have a look at this it may help dontkillmyapp.com
– Ivan Wooll
Mar 22 at 10:02
Can you use an alternative mechanism for getting this information to a
Service
, such as aJobScheduler
?– PPartisan
Mar 22 at 10:12
@IvanWooll thaks for your suggest but I've tried without success
– user3363936
Mar 22 at 10:52