Wie entferne ich die Titelleiste aus der Android-Aktivität?

Kann mir bitte jemand bei dem Problem helfen. Ich möchte, dass meine Aktivität als Vollbild angezeigt wird und der Titel vom Bildschirm entfernt wird. Ich habe verschiedene Möglichkeiten ausprobiert, kann ihn jedoch nicht entfernen.

Aktivitätscode:

    public class welcomepage extends Activity {
    private Button btn;
    EditText userName,passWord;
    DatabaseHandler dbHandler;
    Context ctx =this;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //Remove title bar
        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_welcomepage);
}
}

And Activity.xml

    <?xml version="1.0" encoding="utf-8"?>
   <RelativeLayout    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    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"
    android:background="@drawable/pic1"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context="com.edkul.vimal.edkul.welcomepage">



</RelativeLayout>

Ich möchte die in blauer Farbe angezeigte Titelleiste entfernen. Bitte suchen Sie das Bild als Referenz:

AndroidManifest.xml

<application
        android:minSdkVersion="3"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/Theme.AppCompat.NoActionBar">
        <activity
            android:name=".welcomepage"
            android:label="@string/app_name"
            android:theme="@style/Theme.AppCompat.NoActionBar">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category    android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
</application>

Antworten auf die Frage(14)

Ihre Antwort auf die Frage