I’m looking for the accessor version of Activity’s setResult(). Imagine getResult() to return a Bundle if a resultCode and Intent have been used in setResult().
The reason for this is by default activities load with the resultCode set to RESULT_CANCELED: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.3_r1/android/app/Activity.java#669, and I would like to be able to query the resultCode from the onPause method. This might save a listener for the back button pressed.
Can’t you just save the
resultCodeto a member variable when you set it and read it back inonPasuse?You could also do some something similar with any
Intentyou use.You would have to bear in mind that
onPausewill be called any time that yourActivityis no longer in the foreground, not just when you have set a result and calledfinish().