Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
単一のアクティビティ中にユーザー入力の複数のフィールドを取得し、Java ファイルで計算を行い、結果の値を SAME アクティビティ内のテキスト フィールドに表示する動的テキスト フィールドを作成しようとしています。
これを行う方法はありますか?私は、strings.xml を動的に編集できないことがわかったので、値を常に変更できるようにするために使用できる構造はありますか?
皆さんありがとう。
これはかなり簡単です:
String yourTextValue = "text"; TextView myTextView = (TextView) findViewById(R.id.textView1); myTextView.setText(yourTextValue);
TextView の値を変更するたびに、String 値 (それが何であれ) を指定して setText() を呼び出すだけです。