title: Data List isn't showing up in the Recycler View in the main activity in android app , using kotlin for development.
body: <p>activity_main.xml code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  tools:context="sampleex_recycleview.himanshu.recycleview.MainActivity"&gt;
  
  &lt;android.support.v7.widget.RecyclerView
      android:id="@+id/RecViewId"
      android:layout_width="0dp"
      android:layout_height="0dp"
      android:layout_marginBottom="8dp"
      android:layout_marginEnd="8dp"
      android:layout_marginStart="8dp"
      android:layout_marginTop="8dp"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent" /&gt;
  </code></pre>
  
  <p></p>
  
  <p>Data List for RecyclerView in main activity, list_row.xml code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:background="@color/cardview_shadow_end_color"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"&gt;
  
  &lt;android.support.v7.widget.CardView
      android:layout_width="375dp"
      android:layout_height="140dp"
      android:layout_marginBottom="8dp"
      android:layout_marginEnd="8dp"
      android:layout_marginStart="4dp"
      android:layout_marginTop="8dp"
      app:layout_constraintBottom_toBottomOf="parent"
      app:layout_constraintEnd_toEndOf="parent"
      app:layout_constraintHorizontal_bias="0.0"
      app:layout_constraintLeft_toLeftOf="parent"
      app:layout_constraintRight_toRightOf="parent"
      app:layout_constraintStart_toStartOf="parent"
      app:layout_constraintTop_toTopOf="parent"
      app:layout_constraintVertical_bias="0.0"&gt;
  
      &lt;RelativeLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"&gt;
  
          &lt;ImageView
              android:id="@+id/imageViewPhoto"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentStart="true"
              android:layout_centerVertical="true"
              android:layout_marginStart="13dp"
              android:padding="25dp"
              app:srcCompat="@mipmap/ic_launcher_round" /&gt;
  
          &lt;TextView
              android:id="@+id/AgeTextView"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_alignParentEnd="true"
              android:layout_below="@+id/NameTextView"
              android:layout_marginTop="14dp"
              android:layout_toRightOf="@id/imageViewPhoto"
              android:hint="age"
              android:padding="5dp" /&gt;
  
          &lt;TextView
              android:id="@+id/NameTextView"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_alignTop="@+id/imageViewPhoto"
              android:layout_marginTop="22dp"
              android:layout_toEndOf="@+id/imageViewPhoto"
              android:hint="name"
              android:padding="5dp" /&gt;
      &lt;/RelativeLayout&gt;
  &lt;/android.support.v7.widget.CardView&gt;
  </code></pre>
  
  <p></p>
  
  <p>Main Activity code here : </p>
  
  <pre><code>class MainActivity : AppCompatActivity() {
  
  private var adapter : PersonListAdapter? = null
  private var layoutManager : RecyclerView.LayoutManager? = null
  private var personList : ArrayList&lt;Person&gt;? = null
  
  override fun onCreate(savedInstanceState: Bundle?) {
      super.onCreate(savedInstanceState)
      setContentView(R.layout.activity_main)
  
      personList = ArrayList&lt;Person&gt;()
      layoutManager = LinearLayoutManager(this)
      adapter = PersonListAdapter(personList!!, this)
  
      //set up recycle view
      RecViewId.layoutManager = layoutManager
      RecViewId.adapter = adapter
  
      // loading data
      for(i in 1..15){
          var person = Person()
          person.name = "Person " + i
          person.age = 21 + i
      }
  
      adapter!!.notifyDataSetChanged()
  
    }
  }
  </code></pre>
  
  <p>Adapter Class' code (exists in package name 'Data') : 
  // adapter class for the inflating layout for list in the recycler view and parsing data into the feild components of the layout</p>
  
  <pre><code>class PersonListAdapter(private var list : ArrayList&lt;Person&gt;, var context: Context) :
      RecyclerView.Adapter&lt;PersonListAdapter.ViewHolder&gt;() {
  
     override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
  
      val view = LayoutInflater.from(context).inflate(R.layout.list_row, parent, false)
      return ViewHolder(view)
  }
  
     override fun onBindViewHolder(holder: ViewHolder?, position: Int) {
  
      holder?.bindItem(list[position])
  }
  
      override fun getItemCount(): Int {
      return  list.size
  }
  
      class ViewHolder(itemView : View) : RecyclerView.ViewHolder(itemView) {
  
     fun bindItem(person: Person){
         var Name : TextView = itemView.findViewById(R.id.NameTextView) as TextView
         var Age : TextView = itemView.findViewById(R.id.AgeTextView) as TextView
          Name.text = person.name
          Age.text = person.age.toString()
      }
    }
  
  }
  </code></pre>
  
  <p>Person Class' code (exists in different package name 'Model'): 
  // class for the layout of the data to be shown in the data list in the Recycler view in the main activity</p>
  
  <pre><code>class Person{
      var name : String? = null
      var age : Int? = null
  }
  </code></pre>