Mainactivity - Java: Public Void Int
Mainactivity - Java: Public Void Int
java
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/strA"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/txta"
android:layout_width="82dp"
android:layout_height="wrap_content"
android:ems="10" >
<requestFocus />
</EditText>
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/strB"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/txtB"
android:layout_width="81dp"
android:layout_height="wrap_content"
android:ems="10" />
<Button
android:id="@+id/btnAdditional"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/strAditional" />
<Button
android:id="@+id/btnSubstraction"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/strSubstraction" />
<Button
android:id="@+id/btnMutiplication"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/strMutiplication" />
<Button
android:id="@+id/btnDivition"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/strDivition" />
<TextView
android:id="@+id/lblResult"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/strResult"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/txtResult"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ems="10" />
<Button
android:id="@+id/btnClose1S"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/strClose"
android:onClick="doCloseApplication"
/>
</LinearLayout>
3. String.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Vd3</string>
<string name="action_settings">Settings</string>
<string name="hello_world">Hello world!</string>
<string name="hello">Simple Math Application!</string>
<string name="strA">A=</string>
<string name="strB">B=</string>
<string name="strResult">Result: A+B=</string>
<string name="strAditional">A+B</string>
<string name="strSubstraction">A-B</string>
<string name="strMutiplication">A*B</string>
<string name="strDivition">A/B</string>
<string name="strClose">Close Application</string>
</resources>