開發手持裝置時,多少都會動態更動到Layout View物件
要操作Layout View物件的前提就是物件必須要有id(id命名方式為@+id/your_id)
<TextView
android:id="@+id/check_code"
android:layout_width="match_parent"
android:layout_height="50px"
android:text="TEST"
/>
這樣就可以直接從Java取得物件
TextView check_code = (TextView) findViewById( R.id.check_code );
//更改text(內容)
check_code.setText("Hello");