How to Make an Activity Fullscreen
public class FullScreen extends Activity {
@Override
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);
}
}
9 Comments
Alternatively you can add
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
to AndroidManifest.xml under <activity>
Many thanks !
http://gologle.com, <a href=gologle.com>goolgle</a>
Isn't there an easy way that we non-technical folks could use..??? (I don't understand this)
I had much success. Thanks.
I have pretty much this same code in a sub.. easy to re-use:
public void setFullScreen() {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
Understood it completely. Thanks.
Thanks for sharing! So short and so clear!
It's fine..and useful for learner also
Add a Comment