Skip to content

Instantly share code, notes, and snippets.

@westlinkin
Created January 24, 2013 03:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save westlinkin/4617409 to your computer and use it in GitHub Desktop.
Save westlinkin/4617409 to your computer and use it in GitHub Desktop.
kindle fire full screen
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_video_play);
setFullScreen();
}
private void setFullScreen(){
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
if (VERSION.SDK_INT >= VERSION_CODES.ICE_CREAM_SANDWICH) {
SDK14.setFullScreen(VideoPlayActivity.this);
}
Log.v("set full screen", "done");
}
@TargetApi(14)
static class SDK14 {
public static void setFullScreen(Context context) {
Log.v("set full screen", "api 14");
((Activity) context).getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment