How to give time limit for calling one activity to another activity. I want to call another activity (Ex calling A class to B class) by given some time limit. I used alarmManage
This can also be done using android CountDownTimer
class.
See this example for a 3 second delay.
new CountDownTimer(3000, 1000) {
public void onFinish() {
Intent startActivity = new Intent(ThisActivity.this,ActivityToStart.class);
startActivity(startActivity);
finish();
}
public void onTick(long millisUntilFinished) {
}
}.start();
You may also need to define your parent activity in AndroidManifest.xml
file,