RecyclerView 2 Columns with CardView

Extracted required info from the accepted answer in case URL becomes invalid in future and to save time.

GridLayoutManager is used to display the RecyclerView in Grid manner instead of list.

RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(this, 2);
recyclerView.setLayoutManager(mLayoutManager);

Kotlin version:

recyclerView.apply {
   layoutManager = GridLayoutManager(this, 2)
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)