您可以將activity_my_first.xml中的內容替換爲教程中的內容。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal">
<EditText android:id="@+id/edit_message"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/edit_message" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_send" />
</LinearLayout>
或創建另一個名爲main.xml的xml。本教程假設您已經創建了即時猜測。
只需確保在您的活動的onCreate方法你有
setContentView(R.layout.activity_my_first);