Hide Android TitleBar using code
by Sasikumar[ Edit ] 2014-03-07 16:48:07
To hide android title bar
Sometimes we need to hide title bar in android, while we develope something like games, So we can use the following code block to hide the title bar in android.
public class MainActivity extends Activity
{
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
/* Block of code to hide TitleBar */
requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
/* Block of code to hide TitleBar */
setContentView(R.layout.activity_main);
}
}
Output: