0

Androidアプリケーションで、実行中のサービスの意図を保存すると. サービスを再開するにはどうすればよいですか? onStartCommand 関数を再度実行したい。

ありがとう

4

1 に答える 1

1

返品onStartCommandするSTART_STICKY

public int onStartCommand(Intent intent, int flags, int startId){
   super.onStartCommand(intent, flags, startId);
   return  START_STICKY; 
}

ドキュメント リンク: http://developer.android.com/reference/android/app/Service.html

于 2014-09-25T14:39:30.330 に答える