qiankanglai / ImagePicker

ImagePicker utility for cocos2d-x v3
http://qiankanglai.me/project/2014/04/14/cocos2dx-ImagePicker/
MIT License
24 stars 14 forks source link

onActivityResult never gets called on cocos2d-x 4 #8

Open monkeyibrowstudios opened 10 months ago

monkeyibrowstudios commented 10 months ago

I've being trying to use this in cocos2d-x. It opens the gallery successfully, but right after picking an image, it returns to the application, and nothing happens. Doing some debug, I see that method public boolean onActivityResult is never executed. Any suggestions?

qiankanglai commented 10 months ago

Hi,

I havn't work with cocos2dx for quite some years and not sure cocos2dx v4 has any breaking api or not. (This project is developed and tested with v3).

The key code path is: Cocos2dxHelper.getActivity().startActivityForResult(intent, IMAGE_PICKER_ACTIVITY);->onActivityResult So you can add some log in Cocos2dxHelper.java and Cocos2dxActivity.java, to make sure the correct intent is launched and returned.

If you can provide a simple example to test, I can also help on holiday.