How to Make Unity Work in Android Fragment

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

any idea?

The method requestWindowFuture must be called before super.onCreate(…). In this way the code work

I tried moving requestWindowFuture, but to no avail. Did anyone else get this to work?

I don’t know the answer, but I’d love to help resolve this. My setup: Unity app embedded in an Android fragment (Unity 5.3.2f1 Personal edition, Android Studio 1.5.1); the contents of the fragment appear black.

Unity folks: I’d be happy to help resolve this and write up a tutorial on it, but I need some help just getting it to work. Help! (please)