Skip to content
pyricau edited this page Oct 29, 2012 · 7 revisions

Since AndroidAnnotations 2.7

This annotation is intended to be used on methods to receive results from an activity started with android.app.Activity.startActivityForResult(Intent, int)

The annotation value must be an integer constant that represents the requestCode associated with the given result.

The method may have multiple parameters :

  • A android.content.Intent that contains data returned by the previously launched activity
  • An int or a java.lang.Integer to get the resultCode.

Some usage examples of @OnActivityResult annotation :

 @OnActivityResult(REQUEST_CODE)
 void onResult(int resultCode, Intent data) {
 }
 
 @OnActivityResult(REQUEST_CODE)
 void onResult(int resultCode) {
 }
 
 @OnActivityResult(ANOTHER_REQUEST_CODE)
 void onResult(Intent data) {
 }
 
 @OnActivityResult(ANOTHER_REQUEST_CODE)
 void onResult() {
 }

Using AndroidAnnotations

Questions?

Enjoying AndroidAnnotations

Improving AndroidAnnotations

Clone this wiki locally