Android studio recyclerview java3/9/2023 ![]() ![]() Long: Use Long when RecyclerView's long stable ids are already in use. ![]() String: Use String when a string based stable identifier is available. If items in your view are associated with stable content:// uris, you should use Uri for your key type. This is especially useful in conjunction with Uri as the Android URI implementation is both parcelable and makes for a natural stable selection key for values represented by the Android Content Provider framework. ![]() Parcelable: Any Parcelable type can be used as the selection key. There are also some guidelines and advice on which type to use depending on your use case. You can use whichever type you like but the selection library provides support for three types: Parcelable, String and Long. The documentation first calls to determine the selection key type to use to then build a KeyProvider. implementation 'androidx.recyclerview:recyclerview-selection:1.0.0' Step 2: Select a key type The first step is adding the dependency to our gradle.build file. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |