当Google Play Games初始化时,如何隐藏Android标题栏?

当Google Play Games初始化时,如何隐藏Android标题栏?,android,libgdx,google-play-games,Android,Libgdx,Google Play Games,当我初始化Google Play Games时,当我的游戏加载后,“连接到Google Play Games”窗口出现在开始处,Android标题栏也会立即出现。一旦GPG登录窗口消失,它就会消失。我如何阻止这种情况发生?在我的游戏清单中,我在活动标签中设置了以下样式: android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 这显然是可行的,因为当我的游戏运行时,我看不到工具栏。我查看了Google Play Game Servic

当我初始化Google Play Games时,当我的游戏加载后,“连接到Google Play Games”窗口出现在开始处,Android标题栏也会立即出现。一旦GPG登录窗口消失,它就会消失。我如何阻止这种情况发生?在我的游戏清单中,我在活动标签中设置了以下样式:

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
这显然是可行的,因为当我的游戏运行时,我看不到工具栏。我查看了Google Play Game Services GameBaseUtils清单,它没有任何活动标记,因此我在应用程序标记中添加了NoTitleBar样式,如下所示:

<application
    android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
    <meta-data android:name="unityplayer.ForwardNativeEventsToDalvik" android:value="true" />
</application>


然而,当游戏加载并且Google Play游戏初始化时,标题栏仍然显示(暂时显示)。当GPG初始化时,有没有办法完全去掉标题栏?

onCreate()方法中执行此操作。
干杯


我将您的代码添加到AndroidLauncher中的onCreate方法中,但它不起作用。SetContentView不用于libGDX项目。
//Remove title bar

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

//Remove notification bar
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

//set content view AFTER ABOVE sequence (to avoid crash)
this.setContentView(R.layout.your_layout_name_here);