Log in or register to post comments

How can i found Android's onActivityResult()?

May 30, 2011 - 2:23am #1

I created unity's plugin .jar
My plugin included android's gallery intent source.

Intent intent = new Intent();
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.setType("image/*");
Intent intento = new Intent();
mActivity.startActivityForResult(intento.createChooser(intent,"Select"), REQ_SELECTED_IMAGE);

But,, I can not receive REQ_SELECTED_IMAGE message
at Android's onActivityResult(). because, I can not found QCAR's
onActivityResult() override.

How can i found Android's onActivityResult()?

How can i found Android's onActivityResult()?

August 26, 2012 - 11:28am #9

You'll probably want to override the onBackPressed callback to implement your desired behavior (i.e. resuming the Unity activity )

 

public void onBackPressed ()

Called when the activity has detected the user's press of the back key. The default implementation simply finishes the current activity, but you can override this to do whatever you want.

http://developer.android.com/reference/android/app/Activity.html#onBackPressed%28%29

How can i found Android's onActivityResult()?

August 20, 2012 - 11:29am #8

Yes, I made it work by extending my activity from QCARUnityPlayer. But, now I'm stuck in another problem: On back button press, the new application(Google Maps) opened via android closes, but it doesn't return to the Unity activity that called this application. Any suggestions on this one?

 

Thanks,

Parth

How can i found Android's onActivityResult()?

August 20, 2012 - 11:13am #7

Try using import com.qualcomm.QCARUnityPlayer.QCARPlayerActivity;

I think this had been refactored since that last reply.

How can i found Android's onActivityResult()?

August 18, 2012 - 4:15pm #6

Does PlayerActivity work for Vuforia too? I'm currently using Unity 4.0.0b3, Vuforia 1.5.9 for SDK and v1.5.10 for Unity extension and I get a compilation error: 

PlayerActivity cannot be resolved to a type EclipseIntegration.java /DuMall/src/com/bik3r/DuMall line 10 Java Problem

 I've added QCAR.jar and QCARUnityPlayer.jar to my project.

I'm trying to integrate my Vuforia app with Unity to run another activity for the last three days, but no luck! Any suggestions here?

 

Regards,

Parth

 

Re: How can i found Android's onActivityResult()?

June 1, 2011 - 5:48pm #5

Wow~~
Thanks~ It's great works~!!!

Re: How can i found Android's onActivityResult()?

May 31, 2011 - 2:01pm #4

That's exactly right, you can override our com.qualcomm.QCARUnityPlayer.PlayerActivity activity by extending it using that syntax. Then you can add the onActivityResult() method to that class. Again, you'll need to update the AndroidManifest.xml to use your classname (e.g. OverrideExample) as the starting point.

- Kim

Re: How can i found Android's onActivityResult()?

May 30, 2011 - 7:04pm #3

Thanks for your quick reply.

Your reply means, I make my activity. and my activity is main, QCAR activity is sub activity.
so, I run main My activity. and i call QCAR activity?

i have another quastion.

Can i overide QCAR on my activity?

ex)
package com.company.product;

import com.qualcomm.QCARUnityPlayer.PlayerActivity;

.....

public class OverrideExample extends PlayerActivity{
...
}

Re: How can i found Android's onActivityResult()?

May 30, 2011 - 7:02am #2

Our main activity is called com.qualcomm.QCARUnityPlayer.PlayerActivity. You can extend this activity and add the onActivityResult() override. Just be sure to update the AndroidManifest.xml file with your activity name.

- Kim

Log in or register to post comments