When building Android application, it will have Application Title on top bar as default. We can remove this app title bar with 2 ways. Here is how to remove title bar:
1. Using AndroidManifest.XML
In the Activity, we can set the Theme using NoTitleBar, like this:
1 2 3 4 5 | <activity android:name="com.yodi.calendar.MainActivity" android:theme="@android:style/Theme.Black.NoTitleBar" android:label="@string/app_name" > </activity> |
2. Define in Activity
Which on the files that contain Activity, we can set the RequestWindowFeature with Window.FEATURE.NO_TITLE and set flags before we set the ContentView.
1 2 3 4 5 6 7 8 | @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Remove application title requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.activity_main); … |
Now when we running the application, the title application will be dissapear 🙂