Last active
October 3, 2017 21:14
-
-
Save gcherubini/7a81c2efb02a7a537087f276b0df44eb 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
class HomeActivity : AppCompatActivity() { | |
private val USER_NAME = "Albert Eisten" | |
private val TIMER_SECONDS = 5 | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
val binding: ActivityHomeBinding = DataBindingUtil.setContentView(this, R.layout.activity_home) | |
val user = User(USER_NAME) | |
binding.setVariable(BR.user, user) | |
binding.executePendingBindings() | |
showDialogWhenTimerFinishes() | |
} | |
private fun showDialogWhenTimerFinishes() { | |
val handler = Handler() | |
handler.postDelayed({ | |
showAlertDialog("Press OK and move to next View", DialogInterface.OnClickListener { | |
_, _ -> moveForward(ListActivity()) | |
}) | |
}, (TIMER_SECONDS * 1000).toLong()) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment