Hello
I’m developing a unity android application and it was working within native android application as a seperate activity.But now my customer wants to show unity view in a android fragment . Is something like that possible. If it is how can I do that
I was using the below code to show unity view in android activity. What should I change?
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
unityPlayer = new UnityPlayer(this);
int settingInt = unityPlayer.getSettings().getInt("gles_mode", 2);
unityPlayer.init(settingInt, false);
View v = unityPlayer.getView();
setContentView(v);
v.requestFocus();
String coordinates = globals.deviceLocation.getLatitude()+","+globals.deviceLocation.getLongitude();
UnityPlayer.UnitySendMessage("Main Camera","setCurrentCoordinateToUnity",coordinates);
}
Thanks
Tolga