简体   繁体   中英

hide some Items in recyclerview

I'm having a problem when I want to display 1 of 3 items in itemview, which 3 items I'm calling from sqlite. is there a way to solve this problem without changing the database?

is there a way to display the last 1 data that I marked in red in the image below?

在此处输入图片说明

If i understood what you are trying to do...

You can get rid of duplicated item with distinctBy()

YourList.distinctBy {
            it.WHAT_EVER_YOU_WANT_TO_DISTINCT_BY // maybe by monkeysquad
        })

This will give you the list you got from your SQL query without duplicated items

Hope i got it right

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM