隐藏状态栏和标题栏

1 package game.test;
2
3 import android.app.Activity;
4 import android.os.Bundle;
5 import android.view.Window;
6 import android.view.WindowManager;
7
8 public class GameTest extends Activity {
9 /** Called when the activity is first created. */
10 @Override
11 public void onCreate(Bundle savedInstanceState) {
12 super.onCreate(savedInstanceState);
13 // 隐去电池等图标和一切修饰部分(状态栏部分)
14 this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
15 WindowManager.LayoutParams.FLAG_FULLSCREEN);
16 // 隐去标题栏(程序的名字)
17 this.requestWindowFeature(Window.FEATURE_NO_TITLE);
18 setContentView(R.layout.main);
19 }
20 }
posted @ 2011-02-18 11:21  penink  阅读(191)  评论(0编辑  收藏  举报