RMagen
RMagen

Reputation: 622

How to get original text from EditText

I am new to Android, my question is how to retrieve the original value from the activitMain.xml of the android : text (without saving it to a file) I mean that in the original value was android : text="aaa" then it was changed by the user to "bbb" if i do textView.getText I get the current value (bbb) i want to retrieve aaa

Thanks

Upvotes: 0

Views: 182

Answers (1)

Martin Lund
Martin Lund

Reputation: 1169

(New answer with more knowledge of question)

Maybe you can do it with Strings.xml??

<string name="player_1">Rahav</string>
<string name="player_2">Martin</string>

EditText in your xml file: android:text="@string/player_1"

Then programatically you can set it to the first player.

yourEditText.setText(getResources().getString(R.string.player_1);

Upvotes: 1

Related Questions