title: Android Mvvm, app with more than one activity
body: <p>i am new in android, i am working on an app that retrieve data from server using retrofit and kodein and MvvM in kotlin
  i set a Navigation drawer in my app and the purpose is that when i click on the item of navigation drawer
  new activity opens and in this activity i want show recyclerview
  but when new activty opens  recyclerview cant set listitem on recycler
  i debug my code in my repositories and viewmodel class and i see  that they received data
  i debug my code in new activty and i see that viewmodel cant receive those data and set a invalid icon next to my code in viewmodel.observe</p>
  <p>this is my repository class:</p>
  <pre><code> fun getdigitalproduct(): LiveData&lt;List&lt;DigitalProduct&gt;&gt;{
      val dpData:MutableLiveData&lt;List&lt;DigitalProduct&gt;&gt; = MutableLiveData&lt;List&lt;DigitalProduct&gt;&gt;()
      val apiClient = ApiClient()
  
      val call:Call&lt;List&lt;DigitalProduct&gt;&gt; = apiClient.getClient().create(ApiService::class.java).getdigitalproduct()
      call.enqueue(object : Callback&lt;List&lt;DigitalProduct&gt;&gt;{
          override fun onResponse(
              call: Call&lt;List&lt;DigitalProduct&gt;&gt;,
              response: Response&lt;List&lt;DigitalProduct&gt;&gt;
          ) {
              dpData.value = response.body()
          }
  
          override fun onFailure(call: Call&lt;List&lt;DigitalProduct&gt;&gt;, t: Throwable) {
               dpData.value = null
          }
  
      })
      return dpData
  }
  </code></pre>
  <p>this is for ViewModel</p>
  <pre><code>var repoDigitalProduct: LiveData&lt;List&lt;DigitalProduct&gt;&gt; = repositorys.getdigitalproduct()
  fun getdigitalproduct(): LiveData&lt;List&lt;DigitalProduct&gt;&gt;{
      return repoDigitalProduct
   }
  </code></pre>
  <p>this is for new activity:</p>
  <pre><code>  private fun getDigitalProduct() {
      viewModel.getdigitalproduct().observe(this, Observer {
          digipro.addAll(it)
      })
  </code></pre>
  <p>this is digipro:</p>
  <pre><code>var digipro: ArrayList&lt;DigitalProduct&gt; = ArrayList()
  </code></pre>
  <p>and this i use this code in oncreate method in new activity:</p>
  <pre><code>  viewModel = ViewModelProviders.of(this, factory).get(AllViewModel::class.java)
      getDigitalProduct()
      setdigitalProductRecycler()
  </code></pre>
  <p>i use viewmodelprovider.of code in Mainactivity too</p>
  <p>this is for setdigitalProductRecycler:</p>
  <pre><code> private fun setdigitalProductRecycler() {
      val digiproRecycler = digital_product_recycler
      digiproRecycler.layoutManager =
          LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, true)
      digiproRecycler.adapter = DigitalProductAdapter(digipro)
  }
  </code></pre>
  <p>my codes works in Mainactivity but when i try it in new activity.........</p>
  <p>what should i do?</p>