I want to create a recyleview Layout with 2 columns. There should be a variable that has 2 columns in them.Clicking on them should bring up a toast message
Asked
Active
Viewed 75 times
1 Answers
0
Add a GridLayoutManager to your recyclerview when you set it up with adapter etc, like this:
recyclerview.setLayoutManager(new GridLayoutManager(context, 2));
The 2 is the number of columns. To be clear if you are a beginner, the context param can usually be changed to "this" or getContext() since you usually set the recyclerview up in an activity.
Vanheden
- 453
- 3
- 13
-
bro need help me bro please answer me bro https://stackoverflow.com/questions/67070461/how-to-rss-feed-save-database-insqlite-android – atozcodes Apr 13 '21 at 07:41