stopself() service not working
<p>I need to stop the service from itself and I use the <code>stopSelf</code> method, but the service is not stopped.</p>

<pre><code>@Override
public int onStartCommand(Intent intent, int flags, int startId) {

    int hour = MainActivity.sa3a;
    int minute = MainActivity.dakika;
    java.text.DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
    Date date = new Date();
    System.out.println(dateFormat.format(date));
    int x = date.getHours();
    int y = date.getMinutes();
    String n = String.valueOf(x);
    Toast.makeText(send.this,n, Toast.LENGTH_SHORT).show();
    if (hour == x &amp;&amp; minute == y) {
        Toast.makeText(send.this, "start", Toast.LENGTH_SHORT).show();
        send.this.stopSelf();
        Toast.makeText(send.this, "stop_Self_is_Not_work", Toast.LENGTH_LONG).show();
    } else {
        Toast.makeText(send.this, "yOKKKKKK", Toast.LENGTH_LONG).show();
    }

    return START_STICKY;
}
</code></pre>