Closed GoogleCodeExporter closed 8 years ago
I vote for it !
Can we add support for startActivityForResult(Intent,int) ?
Something like that :
public static void startForResult(Context context, int flags, int requestCode) {
Intent intent = buildStartIntent(context, flags);
context.startActivityForResult(intent, requestCode);
}
public static void startForResult(Context context, int requestCode) {
startForResult(context, 0, requestCode);
}
With a new annotation @OnResult :
@OnResult(MY_REQUEST_CODE)
public onResult(Intent data, int resultCode) {
... blah blah blah ...
}
Both parameters of the onResult method are not mandatory.
Original comment by mat.boni...@gmail.com
on 8 Dec 2011 at 11:47
Ok, that's interesting indeed. It would work quite like onOptionsItemSelected.
One detail though : startActivityForResult is defined in Activity, not Context
(only activities can get activity results).
So we would probably do this :
public static void startForResult(Activity activity, int flags, int
requestCode) {
Intent intent = buildStartIntent(activity, flags);
activity.startActivityForResult(intent, requestCode);
}
public static void startForResult(Activity activity, int requestCode) {
startForResult(activity, 0, requestCode);
}
Original comment by py.ricau
on 8 Dec 2011 at 12:42
Moved the "@OnResult" idea to issue 154.
Original comment by py.ricau
on 30 Dec 2011 at 7:19
This issue was closed by revision 5d117c269dbe.
Original comment by py.ricau
on 30 Dec 2011 at 7:33
Original issue reported on code.google.com by
py.ricau
on 8 Dec 2011 at 11:13