Android UnityPlayerActivity Action Bar

前端 未结 3 740
逝去的感伤
逝去的感伤 2021-02-05 18:44

I am building an Android application which includes a Unity 3d interactive experience.

I have imported the Unity project into Android Studio but when launched the activ

3条回答
  •  情书的邮戳
    2021-02-05 19:29

    I think I've found solution.
    Change that line:

    mUnityPlayer = new UnityPlayer(this);
    

    so it creates your own UnityPlayer subclass, which overrides setFullscreen method (little bit hacky):

    public class UnityPlayerWrapper extends UnityPlayer {
        public UnityPlayerWrapper(ContextWrapper contextWrapper) {
            super(contextWrapper);
        }
    
        @Override
        protected void setFullscreen(boolean b) {
            super.setFullscreen(false);
        }
    }
    

    In addition, please remove that line: requestWindowFeature(Window.FEATURE_NO_TITLE);

提交回复
热议问题