As title says, I'm using since yesterday **Kotlin**. I want to populate a **RecyclerView** with data from **Firebase**.

I tried something, I built an Adapter and tried to populate the **RecyclerView**, my data is going to Firebasebase but not showing in the **RecyclerView** and I get no errors.

I couldn't find any tutorials for my problem with **Kotlin** language

**Here is my Adapter:**

```
class QuestionAdapter(var items : ArrayList<Question>): RecyclerView.Adapter<QuestionAdapter.ViewHolder>() {

override fun getItemCount(): Int {
    return items.size
}

override fun onBindViewHolder(holder: ViewHolder?, position: Int) {
    var userDto = items[position]
    holder?.titleTextView?.text = userDto.titlu
    holder?.msgTextView?.text = userDto.uid
}

override fun onCreateViewHolder(parent: ViewGroup?, viewType: Int): ViewHolder {
    val itemView = LayoutInflater.from(parent?.context)
            .inflate(R.layout.conv_layout, parent, false)

    return ViewHolder(itemView)
}

class ViewHolder(row: View) : RecyclerView.ViewHolder(row) {
    var titleTextView: TextView? = null
    var msgTextView: TextView? = null

    init {
        this.titleTextView = row?.findViewById<TextView>(R.id.titleTextView)
        this.msgTextView = row?.findViewById<TextView>(R.id.msgTextView)
    }
}
}

```

And here is my code for Activity:

```
 private fun populalteQuestionsList() {
    val mChatDatabaseReference = FirebaseDatabase.getInstance().reference.child(Constants.USERS).child(mUserID).child(Constants.CHAT).child(Constants.QUESTION)
    val query = mChatDatabaseReference.orderByChild("time")
    query.addListenerForSingleValueEvent(object: ValueEventListener {
        override fun onDataChange(dataSnapshot: DataSnapshot?) {
            mRecyclerView.layoutManager = LinearLayoutManager(this@MainActivity)
            mRecyclerView.setHasFixedSize(true)
            val  questions = ArrayList<Question>()
            val adapter = QuestionAdapter(questions)
            mRecyclerView.adapter = adapter
        }
        override fun onCancelled(error: DatabaseError?) {
        }
    })
}

```