Calculadora.xml
Autor: Leomar | Publicado: 2015-03-07T09:33:00-08:00

&lt;LinearLayout
&nbsp; &nbsp; xmlns:tools="http://schemas.android.com/tools"
&nbsp; &nbsp; android:layout_height="match_parent"
&nbsp; &nbsp; android:layout_width="match_parent"
&nbsp; &nbsp; android:paddingBottom="@dimen/activity_vertical_margin"
&nbsp; &nbsp; android:paddingLeft="@dimen/activity_horizontal_margin"
&nbsp; &nbsp; android:paddingRight="@dimen/activity_horizontal_margin"
&nbsp; &nbsp; android:paddingTop="@dimen/activity_vertical_margin"
&nbsp; &nbsp; android:orientation="vertical"
&nbsp; &nbsp; xmlns:android="http://schemas.android.com/apk/res/android"
&nbsp; &nbsp; tools:context=".Calculadora"&gt;

&nbsp; &nbsp; &lt;TextView
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="fill_parent"
&nbsp; &nbsp; &nbsp; &nbsp; android:text="Digite o primeiro número"/&gt;

&nbsp; &nbsp; &lt;EditText
&nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/edNumero1"
&nbsp; &nbsp; &nbsp; &nbsp; android:inputType="numberDecimal"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="match_parent"
&nbsp; &nbsp; &nbsp; &nbsp; android:text="0"/&gt;

&nbsp; &nbsp; &lt;TextView
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="fill_parent"
&nbsp; &nbsp; &nbsp; &nbsp; android:text="Digite o segundo número"/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; 
&nbsp; &nbsp; &lt;EditText
&nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/edNumero2"
&nbsp; &nbsp; &nbsp; &nbsp; android:inputType="numberDecimal"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="match_parent"
&nbsp; &nbsp; &nbsp; &nbsp; android:text="0"/&gt;
&nbsp; &nbsp; 
&nbsp; &nbsp; &lt;TextView
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="fill_parent"
&nbsp; &nbsp; &nbsp; &nbsp; android:text="Operações:"/&gt;

&nbsp; &nbsp; &lt;LinearLayout
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="fill_parent"
&nbsp; &nbsp; &nbsp; &nbsp; android:orientation="horizontal"&gt; &nbsp; 
&nbsp; &nbsp; 
&nbsp; &nbsp; &nbsp; &nbsp; &lt;Button
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/btnSomar"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:text="+"/&gt;

&nbsp; &nbsp; &nbsp; &nbsp; &lt;Button
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/btnSubtrair"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:text="-"/&gt;

&nbsp; &nbsp; &nbsp; &nbsp; &lt;Button
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/btnDividir"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:text="/"/&gt;

&nbsp; &nbsp; &nbsp; &nbsp; &lt;Button
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/btnMultiplicar"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; android:text="*"/&gt;
&nbsp; &nbsp; 
&nbsp; &nbsp; &lt;/LinearLayout&gt;

&nbsp; &nbsp; &lt;TextView
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="fill_parent"
&nbsp; &nbsp; &nbsp; &nbsp; android:text="Resultado:"/&gt;
&nbsp; &nbsp; 
&nbsp; &nbsp; &lt;EditText
&nbsp; &nbsp; &nbsp; &nbsp; android:id="@+id/edResultado"
&nbsp; &nbsp; &nbsp; &nbsp; android:inputType="numberDecimal"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_height="wrap_content"
&nbsp; &nbsp; &nbsp; &nbsp; android:layout_width="match_parent"/&gt;
&nbsp; &nbsp; &nbsp; &nbsp; 
&lt;/LinearLayout&gt;