Q: Android EditText.setText() is not updating the Layout, but the EditText has changed So, what is happening is that the EditText won't update. The value has updated, but the value isn't being shown on the screen. In my app, I'm switching layouts a lot, and I'm needing to save the EditText values of the previous layout, to be restored on switching back. This is what I'm doing:
When switching from:
exampleEditText = (EditText)findViewById(R.id.exampleedittext);
exampleEditTextString = exampleEditText.getText().toString();
setContentView(R.layout.secondLayout)

When switching back:
setContentView(R.layout.originalLayout)
exampleEditText.setText(exampleEditTextString);

I'm logging the exampleEditTextString, and then the exampleEditText.getText().toString(); and the values are the same, but it's not displaying on the screen that way. 
Thanks in advance!

A: If you are switching between activities, you need to add
android:launchMode="singleTop"

to your manifest file to prevent the onCreate method each time you start a new activity.
Below is part of the manifest file
<application
    ...
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name"
        android:launchMode="singleTop" >

