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. Dismiss Notice

Need help with finding obb during game.

Discussion in 'Android' started by IronKnight, Oct 31, 2015.

  1. IronKnight

    IronKnight

    Joined:
    Oct 26, 2015
    Posts:
    10
    I read Thread "More Google OBB drama", and saw this : "The OBB is added to the "search path" during a pause/resume cycle of the main activity. Application.dataPath will indicate if it is mounted.
    So you need to trigger that a pause/resume cycle if its not mounted (simplest way would be to init a "dummy" activity that only returns immediately" from eriQue. So i try this, but i think that i am doing wrong, cause i am very very noobish with java and android develop (activities). Here are my code:
    Code (JavaScript):
    1. public class ReloadObbActivity extends Activity {
    2.  
    3.     private Intent myIntent;
    4.  
    5.  
    6.     @Override
    7.     protected void onCreate(Bundle savedInstanceState)
    8.     {
    9.         super.onCreate(savedInstanceState);
    10.         myIntent= new Intent(this,ReloadObbActivity.class);
    11.         finish();
    12.     }
    13.  
    14.     public void Launch()
    15.     {
    16.         startActivity(myIntent);
    17.     }
    18.  
    19. }
    Code (CSharp):
    1.  public static void RunDummyActivity()
    2.     {
    3.         using (AndroidJavaClass unity_player = new AndroidJavaClass("com.unity3d.player.UnityPlayer"))
    4.         {
    5.  
    6.             var jc = new AndroidJavaClass("mycompany.com.reloadobbplugin.ReloadObbActivity");
    7.             jc.Call("Launch");
    8.  
    9.            
    10.  
    11.             if (AndroidJNI.ExceptionOccurred() != System.IntPtr.Zero)
    12.             {
    13.                 Debug.LogError("Exception occurred while attempting to start DownloaderActivity - is the AndroidManifest.xml incorrect?");
    14.                 AndroidJNI.ExceptionDescribe();
    15.                 AndroidJNI.ExceptionClear();
    16.             }
    17.         }
    18.     }
    So what i am doing wrong?
     
  2. IronKnight

    IronKnight

    Joined:
    Oct 26, 2015
    Posts:
    10