开发者

Android hidden title bar comes back

开发者 https://www.devze.com 2023-01-03 03:36 出处:网络
When my app starts, the title bar is hidden. However, if I leave the app and then return (minimize or phone goes to sleep), there is a blank bar inserted at the top. Is this an intentional feature? Ho

When my app starts, the title bar is hidden. However, if I leave the app and then return (minimize or phone goes to sleep), there is a blank bar inserted at the top. Is this an intentional feature? How can I prevent it? It seems that the b开发者_运维技巧ar goes away after I press the menu key.

This is the relevant line in the manifest file:

android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"

Thanks


public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
    WindowManager.LayoutParams.FLAG_FULLSCREEN);        

    setContentView(R.layout.main);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号