Answers for "recyclerview in fragment using kotlin"

0

add recyclerview in fragment

recyclerView1.apply {
            // set a LinearLayoutManager to handle Android
            // RecyclerView behavior
            layoutManager = LinearLayoutManager(activity)
            // set the custom adapter to the RecyclerView
            val notificationobjects : MutableList<Notification> = mutableListOf<Notification>()
            notificationobjects.add(Notification("Zainab Al Khalifa", "Grade-I"))
             recyclerView1.adapter = NotificationAdapter(notificationobjects)

        }
Posted by: Guest on March-08-2021
0

how to add button in recyclerview fragment in kotlin

holder.accept.setOnClickListener {

            if (context != null) {
                context.supportFragmentManager
                    .beginTransaction()
                    .replace(R.id.schoolcontainer, DetailSchoolFragment.newInstance())
                    .commit()
            }

        }
Posted by: Guest on March-23-2021

Code answers related to "recyclerview in fragment using kotlin"

Browse Popular Code Answers by Language