title: Handling input with Android Architecture Components
body: <h2>TL;DR</h2>
  <p>How do I deal with Activities that actively change data (for example through an EditText)? Do I keep saving their state in the SavedInstanceState on rotation and only use the ViewModel when all of the fields are ready, or is there a way to make the ViewModel responsible for checking/holding/using the UI's data?</p>
  <h2>Question</h2>
  <p>I'm developing my application using Google's Arch. Components, and writing my latest class I've noticed I'm not really sure on what the best practice is when handling, say, data coming from an Activity form.</p>
  <h2>Example</h2>
  <p>I have a POJO made of title, description, location, type</p>
  <p>I have an Activity with four EditText: <code>title_et</code>, <code>description_et</code>, <code>location_et</code>, <code>type_et</code>.</p>
  <p>My ViewModel, through a Repository (irrelevant here), can send an object to the Database when the <code>sendObject</code> function is called.</p>
  <h3>How I'm doing it now</h3>
  <p>The activity has the <code>mTitle</code>, <code>mDescription</code>, <code>mLocation</code>, <code>mType</code>.
  On rotation, the activity saves all of the EditText values in the <code>savedInstanceState</code> bundle, and it loads them again populating the views.</p>
  <p>When the user wants to send the object, it clicks a button and the activity calls the function <code>viewModel.sendObject(mTitle, mDescription, mLocation, mType)</code> after the necessary checks.</p>
  <h3>Problems with this approach</h3>
  <p>The activity is responsible of holding/checking all the data of the EditTexts, basically making the ViewModel only responsible of interacting with the Repository.</p>
  <h3>What I'd like to accomplish</h3>
  <p>Ideally, I'd want to make the Activity only responsible of the UI, delegating everything to the ViewModel.</p>
  <p>This way I could call <code>sendObject()</code> and the ViewModel would have already all of the data needed.</p>
  <h3>The LiveData situation</h3>
  <p>Right now the ViewModel has only one instance of LiveData, inside that there is a Resource (which is <a href="https://developer.android.com/topic/libraries/architecture/guide#addendum" rel="noreferrer">taken from here</a>) and it's used to &quot;tell&quot; the Activity that new data has arrived or an error occurred.</p>
  <p>This approach works fine in all Activities that just receive data from the network and display them. What do I do when I want to synchronise data coming FROM the Activity? Do I use one LiveData for each field and use that to display potential errors?</p>
  <p>I've read most of the <a href="https://github.com/googlesamples/android-architecture-components" rel="noreferrer">samples</a> but all of the Activities there are passive.</p>
  <h2>Conclusion</h2>
  <p>Thanks to anyone who takes the time to help.</p>