I need to obtain the path of an image selected from gallery.So I implemented
public static void openGallery(){
UnityPlayer.currentActivity.runOnUiThread(new Runnable() {
public void run() {
intent = new Intent(
Intent.ACTION_PICK,
android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
UnityPlayer.currentActivity.startActivityForResult(intent, 1);
}
});
}
public void onActivityResult(int requestCode, int resultCode, Intent data) {
// here I obtain the path
}
The problem is that onActivityResult never getCalled…