title: How to clear LiveData stored value?
body: <p>According to <a href="https://developer.android.com/topic/libraries/architecture/livedata.html" rel="noreferrer">LiveData documentation</a>:</p>
  <blockquote>
  <p>The LiveData class provides the following advantages:</p>
  <p>...</p>
  <p><strong>Always up to date data:</strong> If a Lifecycle starts again (like an activity going back to started state from the back stack) it receives the latest location data (if it didn’t already).</p>
  </blockquote>
  <p>But sometimes I don't need this feature.</p>
  <p>For example, I have following LiveData in ViewModel and Observer in Activity:</p>
  <pre><code>//LiveData
  val showDialogLiveData = MutableLiveData&lt;String&gt;()
  
  //Activity
  viewModel.showMessageLiveData.observe(this, android.arch.lifecycle.Observer { message -&gt;
          AlertDialog.Builder(this)
                  .setMessage(message)
                  .setPositiveButton(&quot;OK&quot;) { _, _ -&gt; }
                  .show()
      })
  </code></pre>
  <p>Now after every rotation old dialog will appear.</p>
  <p>Is there a way to clear stored value after it's handled or is it wrong usage of LiveData at all?</p>