Android Views and button textedit usage
今天要寫的程式是計算1+2+…+(n-1)+n=? 要用到的東西有: 1.edittext 2.button 很簡單的程式,重點是在如何取得user輸入的資料,以及edittext的使用. 首先,要先了解 TextView, EditText, and Button, the XML layout file (main.xml)格式: < LinearLayout xmlns:android ="http://schemas.android.com/apk/res/android" android:orientation ="vertical" android:layout_width =" fill_parent " android:layout_height =" fill_parent " > < TextView android:id ="@+id/ txtDemo " android:layout_width =" fill_parent " android:layout_height =" wrap_content " /> < EditText android:id ="@+id/ eTxtDemo " android:layout_width =" fill_parent " android:layout_height =" wrap_content " /> < Button android:id ="@+id/ btnDone " android:layout_width =" wrap_content " android:layout_height =" wrap_content " android:text ="Log it" /> LinearLayout &g