2011年8月29日 星期一

getText()

輸入Height:177 Weight:66



myResult.setText(R.string.result);


得到結果 Ur BMI is


myResult.setText(R.string.result+"->"+nf.format(bmi));


得到結果 2130968581->21.07


myResult.setText(getText(R.string.result)+"->"+nf.format(bmi));


得到結果 Ur BMI is->21.07



所以有字串&數字相連就必須正確指定其型態

2011年8月26日 星期五

Android application

Reference:


Button button = (Button)findViewById(R.id.submit);


為了確保宣告的型別跟 XML 描述檔中描述的介面元件型別一致,好使程式運作正常,我們在 「findViewById」 方法前加上 「(Button)」修飾,強制將取得的資源型別設成 「button」型別。

類似flash的 toString. toXxxx 強制轉型態

2011年8月23日 星期二

Blogger with source code

simple



show lines

http://www.commonitman.com/2010/09/how-to-use-syntax-highlighter-3-in.html


Android ListView


<TextView   
android:text="TextView02"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_below="@+id/ItemTitle"
android:id="@+id/ItemText"
/>

android:layout_width="wrap_content",
ListView press state只會出現有content的地方,
要改成fill_parent才會一整條press

Reference:
http://www.iteye.com/topic/540423



test

test