0% found this document useful (0 votes)
23 views

Create An Android Application Which Show The Textview and Edit Text Bar

The document describes how to create an Android application with a RelativeLayout containing two TextViews with text and one EditText. The XML layout code is provided to define the RelativeLayout structure and properties of the TextViews and EditText. The Java code simply sets the content view to the XML layout and hides the action bar.

Uploaded by

Mohd Uwais
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views

Create An Android Application Which Show The Textview and Edit Text Bar

The document describes how to create an Android application with a RelativeLayout containing two TextViews with text and one EditText. The XML layout code is provided to define the RelativeLayout structure and properties of the TextViews and EditText. The Java code simply sets the content view to the XML layout and hides the action bar.

Uploaded by

Mohd Uwais
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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