public class MyService extends Service { final TimerTask task = new TimerTask() {
@Override public void run() {
Log.d("toast", "toast"); timer.cancel();
}
}; final Timer timer = new Timer(); public MyService() {
Log.d("ccc","cccc"); timer.schedule(task, 0, 30); new Thread(new Runnable() {
@Override public void run() { }
}).start(); final Handler handlerThree=new Handler(Looper.getMainLooper());
handlerThree.post(new Runnable(){ public void run(){ if (1>0) { //timer.schedule(task, 0, 3000); }
}
});
}
@Override public IBinder onBind(Intent intent) { // TODO: Return the communication channel to the service. throw new UnsupportedOperationException("Not yet implemented");
}
}