You are on page 1of 2

Create an Android Application which show the TextView and Edit Text

bar.
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:background="#fae500"
tools:context=".Home">

<TextView
android:id="@+id/t1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="30dp"
android:fontFamily="serif"
android:textColor="@color/colorPrimary"
android:text="Text view" />

<TextView
android:id="@+id/t2"
android:layout_marginTop="100dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textSize="40dp"
android:fontFamily="serif"
android:textColor="#ff0004"
android:text="Mohammad Uwais" />

<TextView
android:id="@+id/t3"
android:layout_below="@+id/t2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="100dp"
android:textSize="30dp"
android:fontFamily="serif"
android:textColor="@color/colorPrimary"
android:text="Edit view" />

<EditText
android:id="@+id/e1"
android:layout_below="@+id/t3"
android:layout_marginTop="40dp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>

</RelativeLayout>

JAVA
package com.example.danish.home2;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class Home extends AppCompatActivity {


@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_home);
getSupportActionBar().hide();
}
}

You might also like