When using Android startActivityForResult, I don’t have any guarantee about what I’ll get in the Intent returned by onActivityResult.
I would like to define some kind of interface to limit the possibility of errors when transmitting data from an Activity to another (eg mistyped variable name).
Is there a way to do that? For example could I use something similar to the Android Interface Definition Language but between Activitys?
There are 2 scenarios when passing data between two activities A,B.
on both cases i suggest to create some public static final variables for the extra keys to use.
For example if you need to pass an integer using the key “rating” from A to B i would probably do