×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Java
Posted by: Hafiz Waleed Hussain
Added: Jul 22, 2013 5:46 PM
Views: 154
The bar where we see the time,battery symbol,signals etc. Here now we are writing a code to hide and show that bar.
  1.         public void hideTitle() {
  2.                 try {
  3.                         ((View) findViewById(android.R.id.title).getParent())
  4.                                         .setVisibility(View.GONE);
  5.                 } catch (Exception e) {
  6.                 }
  7.                 getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
  8.                 getWindow().clearFlags(
  9.                                 WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
  10.         }
  11.  
  12.         public void showTitle() {
  13.                 try {
  14.                         ((View) findViewById(android.R.id.title).getParent())
  15.                                         .setVisibility(View.VISIBLE);
  16.                 } catch (Exception e) {
  17.                 }
  18.                 getWindow().addFlags(
  19.                                 WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
  20.                 getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
  21.         }