Log in or register to post comments

How to return from Unity to Android

October 28, 2013 - 6:23am #1

Hello I will comment my problem:

I have a Android project which has got a MainActivity. This activity has a button which launches a Unity project that conatins a only one scene. This scene has a button to order to back to the Android scene. The problem is I don't know how to implement the functionlality of this button to return from Unity scene to the Android Activity. Anybody can help me please?

Thank you in advance. 

How to return from Unity to Android

January 8, 2014 - 7:16am #5

Hi, thanks for this extra bit of information; I have reported this to our engineers so that they can check this.

I will revert back when I have some feedback.

How to return from Unity to Android

January 8, 2014 - 2:58am #4

Have you been able to resolve this issue?

I found out from

http://stackoverflow.com/questions/11099178/oncreate-after-finish-in-onstop

that the QCAR*Activity calls 

Process.killProcess(Process.myPid());

inside the onDestroy() method and that is why your application restarts (can the vuforia developers confirm this?)

I tried to avoid that by launching the activity in a new thread using

Intent i = new Intent(this,MyExtendedQCARActivity.class);

i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);

startActivity(i);

but that didn't change the behaviour (and it doesn't allow me to use startActivityForResult()).

Is there a way to avoid the process killing? Given we deal with all the persistance and lifecycle issues in MonoBehaviour.OnApplicationPause(), is there a way to just stop the activity and then resume it? 

Thanks.

How to return from Unity to Android

October 29, 2013 - 6:54am #3

Hi, with this sentence you abort the execution program and I want to return to the Android activity that called the Unity project.

Anyway thank you very much. 

How to return from Unity to Android

October 28, 2013 - 6:57am #2

One way of exiting the Unity activity is to call Application.Quit();

have you tried that ?

Log in or register to post comments