Urm, I don’t know if this is the right place to ask this or not and I would understand if no one reply’s but how would one go about adding onActivityResult using the plugin. I already have the code ready and tested and in GameActivity.java, their already exists an onActiviyResult method. I’m trying to use the MediaStore content provider.
public void AndroidThunkJava_OpenGallery()
{
Intent Intent = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
startActivityForResult(galleryIntent, RESULT_LOAD_IMG);
}
public void AndroidThunkJava_onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK && null != data) {
Uri selectedImage = data.getData();
String] filePathColumn = { MediaStore.Images.Media.DATA };
Cursor cursor = getContentResolver().query(selectedImage,
filePathColumn, null, null, null);
cursor.moveToFirst();
int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
String picturePath = cursor.getString(columnIndex);
cursor.close();
}
The project compiles and packages but when I try to run it in my phone, the game crashes on launch. This is the only last thing that I wanted to make. After this guide time I have also checked and imported necessary imports