Is it possible to attach two adapters according to the number of two DB tables on one fragment screen? (Explanation photo attached)

Asked 2 years ago, Updated 2 years ago, 55 views

There are two different forms that I receive from the user on one fragment screen So I've made two DB tables! A's cursor list view and attach it as one list view... Is this possible? Regardless of the order, I just want a and b with slightly different layouts to appear in one list view!! Or is there any other way?"T" The information you receive is so different... I don't think we should use two cursor adapters.What method should I use? It's very difficult because it's a beginner development If you don't understand the explanation, please look at the picture!! Is that possible? Please let me know if you know any related examples

android listview fragment custom-listview

2022-09-21 18:34

1 Answers

First of all, it is possible to use two list views for one fragment.

However, there are a number of issues regarding using two list views, such as scrolling and reusing, so unless it's a special case, the trend these days is to use RecyclerView and use multiple layouts.

Simply put, you can use RecyclerView and different view types to use multiple ViewHolder.

Attached is a link to the post on the Toss Lab blog that made the lawn.

http://tosslab.github.io/android/2016/04/09/MultiItemRecyclerAdapter.html


2022-09-21 18:34

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.