Keep a Service Alive in Android 7.1.1 with OxygenOS 4.1.6 -


hi want keep service alive service code

public class  myservice1 extends service{  @override public int onstartcommand(intent intent,int flags,int startdid){ toast.maketext(getapplicationcontext(),"works",toast.lenght_long).show(); return start_sticky; } } 

and manifest file

<service             android:name=".myservice1"             android:enabled="true"              /> 

this runs in android 7.0 when run in android 7.1.1 oxygenos 4.1.6 in 1 plus 3t service gets killed after app closed recent apps services other apps whatsapp , truecaller runs perfectly.


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -