title: Retrieve a TextView Value inside a Adapter Class in Kotlin
body: <p>I have a add and a sub button in my activity, which will increase and decrease the count when the button is pressed. How to get the current value of my textview inside the Adapter class.</p>
  
  <pre><code>inner class MoviesAdapter : RecyclerView.Adapter&lt;MoviesAdapter.MovieViewHolder&gt;() {
  
              val addtocount: TextView=itemView.findViewById(R.id.movieCount)
  
              val testcount:String=addtocount.toString()
  }
  
      public  fun add(view:View)
      {
          movieCount.setText(""+id)
          movieCount.setText("" + ++id)
          println("Final Count is $id")
  
      }
      fun sub(view: View)
      {
          if (id&gt;0) {
              movieCount.setText("" + --id)
          }
          else
          {
              id=0
          }
      }
  </code></pre>