android.developer のドキュメントで彼らが言った理由を誰か教えてもらえますか :just sleep for 30 seconds.
そして、15 * 1000 を入れます。これは 30 秒ではなく、15 だけです。
Runnable mTask = new Runnable() {
public void run() {
// Normally we would do some work here... for our sample, we will
// just sleep for 30 seconds.
long endTime = System.currentTimeMillis() + 15*1000;
while (System.currentTimeMillis() < endTime) {
synchronized (mBinder) {
try {
mBinder.wait(endTime - System.currentTimeMillis());
} catch (Exception e) {
}
}
}
// Done with our work... stop the service!
MyAlarmService.this.stopSelf();
}
};