Tuesday 12 April 2016

My First Android app activity_main.xml file


<?xml version="1.0" encoding="utf-8"?>
<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:padding="@dimen/padding"
    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="com.aupadhyay.myfirstapp.MainActivity">


    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textAppearance="?android:attr/textAppearanceLarge"
        android:text="Enter Details"
        android:layout_marginTop="10dp"
        android:id="@+id/textView"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true" />

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/editTextName"
        android:hint="Enter Name"
        android:layout_below="@+id/textView"
        android:layout_marginTop="42dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true" />

    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/editTextPhone"
        android:hint = "Enter Phone Number"
        android:layout_below="@+id/editTextName"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:layout_marginTop="46dp" />

    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Submit"
        android:id="@+id/button"
        android:layout_below="@+id/editTextPhone"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="46dp" />
</RelativeLayout>

2 comments:

  1. http://stackoverflow.com/questions/36643070/an-android-app-using-autocompletetextview-gives-warning-and-doesnt-get-run-on-e

    ReplyDelete
  2. http://stackoverflow.com/questions/36679682/why-does-this-simple-android-app-gets-crash-after-using-listview

    ReplyDelete