Approach i followed
I set a global varibale to act as a flag if i am launching this activity for the first time. If the global varibale is the same as what i had set, i leave the editText untouched. (in your case, result1). If the value is changed, i set the editText for this value. If the user clicks the editText even once, i track the change and store the value. When you think, the mark1 is no longer needed, you can set the value of flag again as "FIRSTENTRY". This would work.
Kindly try and let us know if you still face issues.
Step 1
Created a class to store a static Global variable.
public class Constants {
public static String sFlag= "FIRSTENTRY";
}
Step 2
Add this piece of code after "setContentView(R.layout.result);" line in your oncreate method. Instead of TextView, i have declared result1 as EditText.
if(!Constants.sFlag.equalsIgnoreCase("FIRSTENTRY"))
{
result1.setText(Constants.sFlag);
}
result1.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// TODO Auto-generated method stub
Constants.sFlag = result1.getText().toString();
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
Constants.sFlag = result1.getText().toString();
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
Constants.sFlag = result1.getText().toString();
}
});