I have a music app in android. Visit http://www.androidhive.info/2012/03/android-building-audio-player-tutorial/ Now I need to close this app with specific time. What is technique I should use?
Thank all
I have a music app in android. Visit http://www.androidhive.info/2012/03/android-building-audio-player-tutorial/ Now I need to close this app with specific time. What is technique I should use?
Thank all
try Timer concept
new CountDownTimer(40000, 1000) { //40000 milli seconds is total time, 1000 milli seconds is time interval
public void onTick(long millisUntilFinished) {
}
public void onFinish() {
}
}.start();
May be you can use AlarmManager. See : http://developer.android.com/reference/android/app/AlarmManager.html Alarm Manager Example
On your AlarmReceiver or your AlarmService, call finish on your activity.