onStartCommand
メソッドの使用時にサービスを停止するにはどうすればよいですか?
使用する必要があることはわかっていますstopService()
が、Eclipse でエラーが発生します。
私はこれまでにこのコードを持っています:
package be.pegus.classapp;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;
public class ClassService extends Service {
private static String tag = "something";
@Override
public IBinder onBind(Intent intent) {
// TODO Auto-generated method stub
return null;
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
return Log.d(tag, "k");
}
@Override
public void onDestroy() {
// TODO Auto-generated method stub
super.onDestroy();
Log.d(tag, "destroy");
}