I have an application built using Corona Enterprise and I want to allow users to open the device camera and/or browse the device gallery and select/capture an image using native code. Then I want the software to process the image in android native code. I know about opening the camera within Corona (lua) and such but that will not work for the app due to the proceeing required for the selected image, hense the native android code part.
I have created the corona part and the native part separately (both work correctly) and my intent is to join the two parts using the Enterprise version but I am stuck trying to access the onActivityResult method that is called after the intents are launched and finished (android startActivityForResult method is used).
I can open the camera fine and browse the gallery fine but after image selection I can’t figure out how to intercept the onActivityResult return data because I think it is calling the method located in com.ansca.corona.CoronaActivity and I don’ have access to that.
Also, I am using a native view that is displayed on top of corona based on the extending UI sample.
Relevant Code: (located in a view that is ceated in CoronaApplication.java, just like the extending UI sample)
Intent intent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
((android.app.Activity)getContext()).startActivityForResult(intent, Config.camera_result_value_success);
public void onActivityResult(int requestCode, int resultCode, android.content.Intent data){
// this is never reached because the method located in com.ansca.corona.CoronaActivity is whats called.
}
Is what I am trying possible?