From 55a2a6ff676cc0f8f85ba545c7c54b2908166164 Mon Sep 17 00:00:00 2001 From: Website Deployment Script Date: Wed, 4 May 2016 07:24:21 +0000 Subject: [PATCH] Updated docs for next --- releases/next/docs/native-modules-android.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/releases/next/docs/native-modules-android.html b/releases/next/docs/native-modules-android.html index 9a2778e3f4b..e8baa14b72a 100644 --- a/releases/next/docs/native-modules-android.html +++ b/releases/next/docs/native-modules-android.html @@ -178,7 +178,7 @@ componentWillMount: // handle event. }); } -...

Getting activity result from startActivityForResult #

You'll need to listen to onActivityResult if you want to get results from an activity you started with startActivityForResult. To to do this, the module must implement ActivityEventListener. Then, you need to register a listener in the module's constructor,

reactContext.addActivityEventListener(this);

Now you can listen to onActivityResult by implementing the following method:

@Override +...

Getting activity result from startActivityForResult #

You'll need to listen to onActivityResult if you want to get results from an activity you started with startActivityForResult. To do this, the module must implement ActivityEventListener. Then, you need to register a listener in the module's constructor,

reactContext.addActivityEventListener(this);

Now you can listen to onActivityResult by implementing the following method:

@Override public void onActivityResult(final int requestCode, final int resultCode, final Intent intent) { // Your logic here }

We will implement a simple image picker to demonstrate this. The image picker will expose the method pickImage to JavaScript, which will return the path of the image when called.

public class ImagePickerModule extends ReactContextBaseJavaModule implements ActivityEventListener {