How to hook activity result in android

#1

I use RegisterAndroidOnActivityResultListener to hook main activity result, with callback:

static void takephoto_onActivityResult(void *env, void *activity, int32_t request_code, int32_t result_code, void *result)
{}
dmExtension::RegisterAndroidOnActivityResultListener(takephoto_onActivityResult);

how can I use the result parameter?In a standard onActivityResult, the prototype is:
protected void onActivityResult(int requestCode, int resultCode, Intent data)
How can I convert the result to Intent?

0 Likes

#2

The result is a pointer to a JNI jobject type referencing the Intent data. You need to use the JNI APIs to call whatever functions you need to get the data from the Intent.

0 Likes

#3

OK, I’ll have a try.

0 Likes