I want to hide the app title bar.
To hide the Title Bar using the Android Manifest. xml file you need to set the Android theme to NoTitleBar like this: android:theme="@android:style/Theme. NoTitleBar">
You have two ways to hide the title bar by hiding it in a specific activity or hiding it on all of the activity in your app. You can achieve this by create a custom theme in your styles. xml . If you are using AppCompatActivity, there is a bunch of themes that android provides nowadays.
You can do it programatically:
import android.app.Activity; import android.os.Bundle; import android.view.Window; import android.view.WindowManager; public class ActivityName extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // remove title requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.main); } }
Or you can do it via your AndroidManifest.xml
file:
<activity android:name=".ActivityName" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"> </activity>
Edit: I added some lines so that you can show it in fullscreen, as it seems that's what you want.
use
<activity android:name=".ActivityName" android:theme="@android:style/Theme.NoTitleBar">
You can do it programatically: Or without action bar
//It's enough to remove the line
requestWindowFeature(Window.FEATURE_NO_TITLE);
//But if you want to display full screen (without action bar) write too
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.your_activity);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With