user16801724
user16801724

Reputation: 15

How to connect RecyclerView to class?

Here is my code, I just don't fully understand how RecyclerView works.

    class EditActivity1: AppCompatActivity(), FfragmentInterfes {
        lateinit var mBinder : ActivityEdit1Binding
        lateinit var imageAdapter:ImageAdapter
        private var dialog=D()
        private var chooseImageFrog:FragmentList? =null
        var editImagePos= 0
        public override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            imageAdapter = ImageAdapter()
            mBinder=ActivityEdit1Binding.inflate(layoutInflater)
            setContentView(mBinder.root)
            init()

        }

Upvotes: 1

Views: 51

Answers (1)

Gandhi Wibowo
Gandhi Wibowo

Reputation: 36

just like the name, RecyclerView is a class that used for represent a list of data.

Example case, if you have profile page, you will bind user name data to some of textview. But how if you have a lot data with same pattern ? let says you you have a list of contacts data, there is have a phone number and name data.

there is RecyclerView will work for you, they will help you to bind the data to the View.

about how to connect RecyclerView. you can search with easily on google. there is lot of example

Upvotes: 2

Related Questions