android-adapter Questions

2

Every time I call invalidate data my DIFF_UTIL is not used. The logs are not shown and the entire list is updated with new data causing the screen to move positions etc. Not sure what the issue is ...
Gasperoni asked 19/9, 2019 at 17:57

2

Solved

Can write common adapter for different views? I am interested in common adapter for recyclerView and spinner. In my project i have RecyclerView and Spinner and i want to write base generic adapter ...

6

Solved

public abstract class BaseAdapters extends RecyclerView.Adapter<BaseAdapters.MyViewHolder> implements View.OnClickListener { protected Context parentContext; public int layout_id; protect...
Marquismarquisate asked 5/10, 2018 at 10:55

3

I'm using Paging Library to load data from network using ItemKeyedDataSource. After fetching items user can edit them, this updates are done inside in Memory cache (no database like Room is used). ...

3

I am developing an android app in which I'm storing two different types of information on 'FirebaseDatabase`. Then in the MainActivity, I'm retrieving them and showing to users in a RecyclerView. ...

6

Solved

I got a FragmentPagerAdapter. It's getItem method can return a fragment according to data it has from the outside. After I update the data its suppose to display I call notifyDataSetChanged and yet...

3

I have created an adapter which is working fine. Now, I need to get a count of the no of data items in the adapter. i am using the function getItemcount() ,but I am getting a 0 every time. ALso, I ...

0

I would like two things : To not reload / refresh the adapter when i delete an item inside RecyclerView (no use of notifyDatasetChanged). To do so i am using DiffUtils which works perfectly fine...

5

Solved

I am using dataBinding in my project to populate a RecyclerView. How can I handle clicks on items? Here is my XML layout: <?xml version="1.0" encoding="utf-8"?> <layout...

1

Solved

I have a pretty common scenario, but I am stuck trying to figure out how to retrieve data from certain json objects within the same json response but returning different size of items. To make it l...
Urgency asked 27/11, 2019 at 23:11

8

I extended RecyclerView.Adapter<RecyclerView.ViewHolder> And when I called: mRecyclerView.getAdapter().notifyDataSetChanged(); Nothing happened. The only way to refresh the view is t...

2

I am implementing multiple ViewHolders as suggested in this answer which uses an abstract bind(). My current Adapter and ViewHolder looks likes: // MyAdapter.java {adapter code} public static ab...

2

Solved

I have an app with a RecyclerView filled with some cards, with help of a custom RecyclerView (RV) Adapter I made. I then tried to follow this tutorial in order to add a transition between activitie...

7

Solved

I have a RecyclerView horizontal image slider at the bottom of a fragment. The top of the fragment shows some details. Once the user clicks on the images at the bottom, the idea is to remove ...
Superfluous asked 31/7, 2017 at 10:24

3

Solved

Hi how to update listView when back pressed in another activity. I am using database, where i am deleting particular row in one Activity, if back pressed alone, it's not updating. When i switch ove...
Convexoconcave asked 16/2, 2016 at 11:7

4

Solved

I'll show the code and after the steps to get the problem. I have a recyclerview inside a tabbed fragment that takes the dataset from a custom object: mRecyclerView = (RecyclerView) v.findViewByI...
Bicameral asked 2/5, 2016 at 15:26

1

I'm getting a "removeView(View) is not supported in AdapterView" exception when running my app in Android version 8.1 and 9.0. In previous versions it runs fine. Although the error is consistent it...
Kaifeng asked 5/1, 2019 at 0:47

3

Solved

I'm using the Room and Paging libraries to display categories. My Entity: @Entity(tableName = Database.Table.CATEGORIES) data class Category( @PrimaryKey(autoGenerate = true) @ColumnInfo(name = ...

2

Each item on my RecyclerView has a button that has three states: OPEN, LOADING, and CLOSED. Initially all the buttons are in the OPEN state. When a button is clicked, the state is changed to LOADI...
Immunochemistry asked 28/3, 2016 at 9:44

3

Solved

I am actually using a GridLayoutManager with two columns in my app and I would like to have one column depending on the view type used. Here is the code I have in the method "onCreateView()" of my...
Aman asked 12/6, 2015 at 16:43

2

How can I show dates in an app when I scroll the ListView like in WhatsApp? See the below image for clarity: When I scroll the ListView, the date gets displayed over the list. If you still did n...

3

Solved

I want to Refresh a ListView in a Fragment when a Dialog is closed. Until now the refresh only works when I restart the app and I don't really know why. Here are the classes: This is the Fragment...

6

Solved

Here is the code of the fragment in which I am setting a custom adapter to the list. There no errors but the ListView is empty. I have implemented getCount() which returns right number of items i...
Outspeak asked 2/5, 2013 at 12:37

10

Solved

I want to know when, where and how adapters are used in the context of Android. The information from Android's developer documentation was insufficient for me and I'd like to get a more detailed a...
Mantellone asked 9/9, 2010 at 8:28

10

Solved

I'm using the v4 compatibility ViewPager in Android. My FragmentActivity has a bunch of data which is to be displayed in different ways on different pages in my ViewPager. So far I just have 3 inst...

© 2022 - 2024 — McMap. All rights reserved.