How to do it…

Creating an intent in Anko is very simple. Let's check the following steps:

  1. The functionality for which we wrote the preceding code can be achieved in just a few lines with Anko:
startActivity(intentFor<SomeActivity>("data" to 5).singleTop())
  1. If you don't want to add the flag, it is much simpler:
startActivity<SomeActivity>("data" to 5)
  1. Adding extra data doesn't require extra lines:
startActivity<SomeActivity>("data" to 5, "another_data" to 10)