I am going through some of the Android development tutorials, and I just came up with this general question:
Why is it that the intent.putExtra method takes a key value pair and not just a value?
If I want to pass a string to the new Intent, why not just pass the String? What benefits does the key have?
You can add more than one object to your
Intentso you could do this:If you want to get the some of the data back you need to specify which using the key: