Why Define Android Activity Result_ok -1
/** Standard activity result: operation succeeded. */ public static final int RESULT_OK = -1; why define RESULT_OK -1 in android activity,not 1?
Solution 1:
As for why "-1" was chosen, one can only guess. My best guess is that Android is trying to ensure that RESULT_OK does not collide with user-defined constants. That is, when you develop an Activity and define your own response codes, you would likely chose positive integer values. If RESULT_OK was "1", then there is a higher probability that an app developer might chose that as well.
Just my theory.
Post a Comment for "Why Define Android Activity Result_ok -1"