Create An Android Application Which Show The Textview and Edit Text Bar
Create An Android Application Which Show The Textview and Edit Text Bar
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;