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
Let's hope following example may help.
Here I have call MainActivity.java
after certain time (2 seconds in this example) from MainPage.java
public class MainPage extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main_page);
Handler handler=new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
startActivity(new Intent(MainPage.this,MainActivity.class));
}
},2000L);
}
}