- Home /
Android/Unity/Eclipse Help
Hey so ive been trying to make a popup window. I have unity integrated with eclipse, and I have the popup window showing. Here is the code.
Code: package com.Patt.AppOne;
import com.unity3d.player.UnityPlayerActivity; import android.app.Dialog; import android.content.Intent; import android.os.Bundle; import android.widget.PopupWindow;
public class AppTwo extends UnityPlayerActivity { //Called when the activity is first created. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //set up main content view setContentView(R.layout.main);
Dialog dialog = new Dialog(AppTwo.this); dialog.setContentView(R.layout.popup_layout); dialog.setTitle("This is my custom dialog box"); dialog.setCancelable(true); //there are a lot of settings, for dialog, check them all out!
//now that the dialog is set up, it's time to show it
dialog.show();
}
public void Launch() {
}
}
it will make a popup window right when i launch if it i dont comment out the line
setContentView(R.layout.main)
but if I comment out the line it will load the unity project i have in there, which is just a button. If I click the button it will call the java Launch function. but if I put the popup code in there, or even just a text printout, you wont see it. I think it goes behind the unity content. Any ideas why
Have a look at this guide I made: http://forum.unity3d.com/threads/98315-Using-Unity-Android-In-a-Sub-View
It explains ho to use unity in a sub view in an android app. I would think from that you can make unity play in a lower hierarchical position in the layout. That should force the unity to be rendered underneath what you want.