Androidアプリ開発初心者です。電卓アプリケーションを作成しようとしていますが、2 つの質問があります。
1. LinearLayout で新しい行を作成するにはどうすればよいですか? 現在、次のようになっています。
[テキストビュー][テキストビュー][ボタン]
そして、私はそれを次のようにしたい:
[テキストビュー][テキストビュー]
[ボタン]
これは私のxmlコードです:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity" >
<TextView
android:id="@+id/number1"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/number1" />
<TextView
android:id="@+id/number2"
android:layout_weight="1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:hint="@string/number2" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_calculate" />
2.「number1」と「number2」の Textview の合計を処理し、メイン アクティビティ (TextView がある場所) に表示するにはどうすればよいですか?