Last active
October 3, 2017 21:14
-
-
Save gcherubini/36d65c490964f7557edcf630c2b5a7d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HomeActivityJava extends BaseActivityJava { | |
private final String USER_NAME = "Albert Eisten"; | |
private final int TIMER_SECONDS = 5; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
ActivityHomeBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_home); | |
User user = new User(USER_NAME); | |
binding.setVariable(BR.user, user); | |
binding.executePendingBindings(); | |
showDialogWhenTimerFinishes(); | |
} | |
private void showDialogWhenTimerFinishes() { | |
final Handler handler = new Handler(); | |
handler.postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
showAlertDialog("Press OK and move to next View", new DialogInterface.OnClickListener() { | |
@Override | |
public void onClick(DialogInterface dialogInterface, int i) { | |
moveForward(new ListActivity()); | |
} | |
}); | |
} | |
}, TIMER_SECONDS * 1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment