This example explains how you can remove title bar from your activity.
Algorithm:
1.) Create a new project by File-> New -> Android Project name it RemoveTitleBar.
2.) Write following into main.xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".RemoveTitleBarActivity" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" /> </RelativeLayout>
3.) Run for output.
Steps:
1.) Create a project named RemoveTitleBar and set the information as stated in the image.
Build Target: Android 4.4
Application Name: RemoveTitleBar
Package Name: com.example.RemoveTitleBar
Activity Name: RemoveTitleBarActivity
2.) Open RemoveTitleBarActivity.java file and write following code there:
package com.example.removetitlebar; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.Window; public class RemoveTitleBarActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); setContentView(R.layout.main); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.remove_title_bar, menu); return true; } }
3.) Compile and build the project.
Output
Launch Selected Activity From ResolveInfo
Creating A Custom Title Bar
Top 10 Android App Development Trends | 2020 Guide
5 Best Resources to Get Started with Android Nougat
Android Studio Introduction
Services – An Android Component
Applying MediaCodec On An Open Source Android Audio Player
5 Most Used Android Testing Frameworks