Background Services not work while application remove from task manager?

  • Replies:0
  • OpenNot stickiedUnanswered
  • Forum posts: 1

Aug 6, 2016 2:38:48 PM via Website

I used service in the application for make application continuously active at the background. It works all the version of android except in lollipop. Please help me for this. I used Alarm service for this. Please help
me for the lollipop device. In the menifest i used following
android:name=".MyTestService"
android:process=".Broadcast_alram"
android:exported="false" >

This is the Service.

public class MyTestService extends IntentService {

public MyTestService() {
    super("MyTestService");
}

@Override
protected void onHandleIntent(Intent intent) {
    // Do the task here
    Log.i("MyTestService", "Service running");

   // Toast.makeText(getApplicationContext(),"Start background",Toast.LENGTH_LONG).show();
}

@Override
public int onStartCommand(Intent intent, int flags, int startId) {

    return START_STICKY;


}

@Override
public IBinder onBind(Intent intent) {
    return super.onBind(intent);
}

@Override
public void onDestroy() {
    super.onDestroy();
    Log.i("MyTestService", "Service Destroy");
}

}