Android service is restarting slowly

邮差的信 提交于 2019-12-24 23:45:21

问题


I have created a service and returned "START_REDELIVERY_INTENT" in "onStartCommand()" method, as i want to run the service even after destroying the App's MainActivity.

App should restart just after destroying the App with previous non-null intent. But App is taking some time to restart. We can see the status of restarting App in device setting (Below is snapshot). This snapshot is after destroying App..... What i do? Any Help please?

public int onStartCommand(Intent intent, int flags, int startId) {
    // TODO Auto-generated method stub
    super.onStartCommand(intent, flags, startId);
    Log.d(TAG, "intent: "+intent);

    return START_REDELIVER_INTENT;
}

来源:https://stackoverflow.com/questions/27398487/android-service-is-restarting-slowly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!