title: Restore View to original xml state
body: <p>In Android, is there an easy way to restore a view to the state as defined in the xml?</p>
  
  <p>For example, I have this view in xml:</p>
  
  <pre><code>&lt;EditText
      android:id="@+id/set_text"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:inputType="text"
      android:ems="10"
      android:visibility="gone" &gt;
  &lt;/EditText&gt;
  </code></pre>
  
  <p>Now programmatically, the visibility is set to visible, the user enters text into it, an error gets set with <code>.setError</code>, and now I want to simply revert the view to it's original state, without having to explicitly do:</p>
  
  <pre><code> view.setVisibility(View.GONE);
   view.setText("");
   view.setError(null);
  </code></pre>