Log in or register to post comments

Destroy the Unity + Qualcomm instance

October 5, 2012 - 1:21am #1


In my android app, I'm calling the Unity + Vuforia (qualcomm) side which opens the camera view and using image target load and play a game. Then it goes back to the android side. In the android app when I exit the application(closing all the activities with finish()) it goes back to the unity + camera view. I close all the activities with finish() correctly. Not sure what I need to close/destroy the unity/vuforia instance.
When coming back to the android side from the unity if I call Application.Quit() it closes the whole app..not just the unity part...
Is there any method to close/destroy just the unity/qualcomm instance either within the unity side or from the android side.?



Destroy the Unity + Qualcomm instance

February 2, 2015 - 8:44am #5

Hi , I have a similar issue in my android app. I have an android app which by pressing a button it should get me to the AR scene.

I have made my AR project in unity and exported it to eclipse and then added other activities to it.

when I press the button I do this code : 

Intent intent= new Intent(getApplicationContext(), QCARPlayerNativeActivity.class);
and the app goes to the AR scene. Now I want to be able to go back to the normal activity which has the button. I tried pressing back but it didn't work
And I tried to use it but again no luck. I think it doesn't work because I go to QCARPlayerNativeActivity class but I don't have any access to this class to override its onBackPressed() function.
I'll appreciate if you can help me with this.
Thanks very much

Destroy the Unity + Qualcomm instance

October 10, 2012 - 11:17am #4

Thanks for the tip. Please post an example of your code if you can.

Destroy the Unity + Qualcomm instance

October 9, 2012 - 7:52am #3

For anyone having a similar issue...

Later when testing, realized that calling super.onDestroy(); closes my app completely in some phones.

So finally found a better solution.
In the activity which extends the Unity activity (or QCARPlayerActivity/QCARPlayerProxyActivity ), when calling the next activity called it like startActivityForResult(Intent, int) instead of startActivity and added another method in that class onActivityResult(int, int, Intent). And called finish() inside this method.

Now it seems to work fine and properly close the Unity instance.

Destroy the Unity + Qualcomm instance

October 5, 2012 - 4:52am #2

I fixed the unity instance closing issue like this

Extended the QCARPlayerActivity (earlier I had QCARPlayerProxyActivity )
Called super.onDestroy(); in the public void onPause() method of the activity which extends the QCARPlayerActivity ... called onDestroy within some if condition...

Also set android:noHistory="true" for QCARPlayerProxyActivity,  QCARPlayerNativeActivity in application manifest file and QCARPlayerActivity, QCARPlayerProxyActivity,  QCARPlayerNativeActivity in unity library manifest file.  (Dont' know whether this is necessry or not)

It works but not sure whether that's a proper way to do it.

Log in or register to post comments