2010年10月30日星期六

Android 全屏窗口 - fullscreen

 1 import android.app.Activity;
 2 import android.os.Bundle;
 3 import android.view.Window;
 4 import android.view.WindowManager;
 5
 6 public class KKAdActivity extends Activity {
 7         /** Called when the activity is first created. */
 8         @Override
 9         public void onCreate(Bundle savedInstanceState) {
10                 super.onCreate(savedInstanceState);
11
12                 /* set the window on FULLSCREEN mode */
13                 getWindow().setFlags(
14                         WindowManager.LayoutParams.FLAG_FULLSCREEN,
15                         WindowManager.LayoutParams.FLAG_FULLSCREEN
16                 );
17                 /* hide the title bar */
18                 requestWindowFeature(Window.FEATURE_NO_TITLE);
19              
20                 setContentView(R.layout.main);
21
22         }
23 }

没有评论:

发表评论