Hi Guys, Maybe you all are expert in terms of using RecyclerView in android. This blog is simple example for using filter option with RecyclerView adapter. As for now you will instantiate RecyclerView and set the adapter to RecyclerView as following way. RecyclerView list = (RecyclerView) findViewById(R.id.list); list.setLayoutManager(new LinearLayoutManager(this)); list.setHasFixedSize(true); ArrayList<Number> numbers = new ArrayList<>(); String ONEs[] = {"ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE", "TEN"}; String TENs[] = {"ZERO", "TEN", "TWENTY", "THIRTY", "FOURTY", "FIFTY", "SIXTY", "SEVENTY", "EIGHTY", "NINETY", "HUNDRED"}; String HUNDREDS[] = {"ZERO", "HUNDRED", "TWO HUND...
Here is the simple example of using RadioGroup, RadioButton in Android Kotlin.
OnCheckedChangeListener
Here is the full video tutorial
If you are really interested in this code, then please share this post with your friends.
Text WhatsApp message to +91-99654 70689 To join Android Developers WhatsApp group.
Join WhatsApp group by this link
Thank You
<RadioGroup xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/radioGroup" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.guna.kotlinapplication.BlankFragment"> <RadioButton android:id="@+id/radioMale" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/male" /> <RadioButton android:id="@+id/radioFemale" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/female" /> </RadioGroup>
OnCheckedChangeListener
radioGroup.setOnCheckedChangeListener({ group, checkedId -> val radioButton = view.findViewById<RadioButton>(checkedId) Toast.makeText(activity, radioButton.text.toString() + " is checked", Toast.LENGTH_LONG).show() })
Here is the full video tutorial
Interesting right?
If you are really interested in this code, then please share this post with your friends.
Text WhatsApp message to +91-99654 70689 To join Android Developers WhatsApp group.
Join WhatsApp group by this link
Thank You
Comments
Post a Comment