Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Finishing Unity and go back to Android

Discussion in 'Android' started by Santy, Oct 24, 2013.

  1. Santy

    Santy

    Joined:
    Apr 16, 2013
    Posts:
    26
    Hello.

    I have exported Unity project to Eclipse and integrated it with my Android project. I can launch Unity project but I can not go back to my project. I have been reading about this on the Internet and have tried everything, but I do not get it.

    Please, anyone know how to do it? I have a button in the Unity scene and I want to change to another activity when the user presses the button.

    This is really urgent, please any help will be welcomed.

    Thank you in advance.
     
  2. Trilusion

    Trilusion

    Joined:
    Mar 20, 2013
    Posts:
    60
    Maybe this helpds... it's pretty easy to call a static java function from within Unity like this:

    private AndroidJavaClass javaclass = new AndroidJavaClass("com.company.product.CustomActivity");
    javaclass.CallStatic("switchActivity");

    I had little luck calling non-static functions though...
     
  3. Santy

    Santy

    Joined:
    Apr 16, 2013
    Posts:
    26
    Thank you Trilusion, but I think we can not use that, because we don't have any Android plugin, we exported the Unity project as an Eclipse project and included it in other Android project. (May be I am wrong but I think that if you use AndroidJavaClass.CallStatic method you need to have that class inside your Unity project).

    Thank you anyway!