can you help me with example code of a time limit. can anyone here show complete code exactly how to implmeent or have a time limit in one class that will intent in the next class if the user didnt click the button. scenario- within 5 sec the user must click the button to intent in another class but if he reached the 5 sec time limit he will be intent to mainmenu.class - its like a game that you must be fast clicking buttons :) hope can help me
a.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(getApplicationContext(),"CORRECT!",
Toast.LENGTH_SHORT).show();
Intent intent = new Intent(getApplicationContext(),EasyTwo.class);
startActivity(intent);