title: Kotlin ViewModel List of String
body: <p>I am new to Kotlin and ViewModel uses.
  I am trying to create a simple ViewModel which got a List of String.
  The idea is to update a list a picture path (String) in this ViewModel.</p>
  
  <p>My issue is that my ViewModel is not updating. It only add 1 entry.</p>
  
  <pre><code>class PicturesViewModel : ViewModel() {
  
      var pictureListLive: MutableLiveData&lt;MutableList&lt;String&gt;&gt; = MutableLiveData()
  
      var list = ArrayList&lt;String&gt;()
  
      fun addPictureToList(picture: String) {
          list.add(picture)
          pictureListLive.value = list
      }
  }
  </code></pre>
  
  <p>In my activity I initialize the viewModel and observe like that :</p>
  
  <pre><code> private fun configureViewModel(){
          this.picturesViewModel = ViewModelProviders.of(this).get(PicturesViewModel::class.java!!)
          this.picturesViewModel.pictureListLive.observe(this, Observer{
              if (it != null) {
                  Log.i("Pictures",it.size.toString())
              }
          })
      }
  </code></pre>
  
  <p>And I add one String to the ViewModel :</p>
  
  <pre><code>override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
          if (resultCode == Activity.RESULT_OK &amp;&amp; requestCode == REQUEST_IMAGE_CAPTURE) {
              picturesViewModel.addPictureToList(currentPhotoPath)
              val intentPreview = Intent(this,PreviewActivity::class.java)
              intentPreview.putExtra("Picture",currentPhotoPath)
              startActivity(intentPreview)}
  
          if (resultCode == Activity.RESULT_OK &amp;&amp; requestCode == REQUEST_CHOOSE_PHOTO){
              this.pictureSelectedPath = data?.data.toString()
              Log.i("Photo",pictureSelectedPath)
          }
      }
  </code></pre>
  
  <p>The ActivityOnResult come from after taking a picture to the camera. I want to update the list of String of the ViewModel to add the picture camera path after taking few pictures.</p>
  
  <p>When I am using it like that today the Size of the ViewModel list remains to 1. I think only the last one is in it.</p>
  
  <p>Thanks for your help.</p>