Android examples for android.app:Screen
hide Title Bar by toggle Full Screen
import android.app.Activity; import android.view.Window; import android.view.WindowManager; public class Main { public static void setFullScreen(Activity activity) { toggleFullScreen(activity, true);/*from w w w.j a v a 2s .c o m*/ } public static void toggleFullScreen(Activity activity, boolean isFull) { hideTitleBar(activity); Window window = activity.getWindow(); WindowManager.LayoutParams params = window.getAttributes(); if (isFull) { params.flags |= WindowManager.LayoutParams.FLAG_FULLSCREEN; window.setAttributes(params); window.addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); } else { params.flags &= (~WindowManager.LayoutParams.FLAG_FULLSCREEN); window.setAttributes(params); window.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS); } } public static void hideTitleBar(Activity activity) { activity.requestWindowFeature(Window.FEATURE_NO_TITLE); } }