Objective: simpler and arguably more elegant design by making object
oriented and remove the mass of switch statements that result using
only
one fixed callback method - onActivityResult(), Request Code and
Result Codes.

Suggestion: modify API so that calling startActivityForResult() will
be
instead startActivityForResult(callbackMethodName).

where callbackMethodName is a method. We could simply use a String
rather
than Method, to keep things simple.

callbackMethodName(Bundle result) {
}

If an error happens in the sub activity, then the exception that is
thrown,
is delivered to callbackMethodName() which must contain an empty try
block
at the beginning.
try{
} catch(e1){
handle exception e1 thrown in the call to the sub activity
} catch(e2) {
handle exception e2 thrown in the call to the sub activity
}
now other normal code in callbackMethodName()

Any other result information is communicated by the Bundle result
parameter.

(I have submitted it as a suggestion in issue tracker.
http://code.google.com/p/android/issues/detail?id=1520)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to