How to stop service after using onstartcommand?
<p>How can i let my service stop when using the onstartcommand method? I know i have to use   stopService() but then eclipse is giving me an error. I have this code so far:</p>

<pre><code>    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");
}
</code></pre>

<p>Thanks for any help.</p>
