Questions tagged [android-adapter]

An Adapter object acts as a bridge between an AdapterView and the underlying data for that view.

android-adapter
Filter by
Sorted by
Tagged with
2 votes
0 answers
180 views

Customview inside viewpager in android not changing when nightmode is enabled

We are implementing the nightmode support for android with: AppCompatDelegate.setDefaultNightMode(if(active) AppCompatDelegate.MODE_NIGHT_YES else AppCompatDelegate.MODE_NIGHT_NO) However it works on ...
Bram Jongebloet's user avatar
0 votes
1 answer
1k views

Error when initialize viewHolder in RecyclerView adapter

How should I initialize viewHolder? I have this error: What I need to do is to get selected item in recyclerView but without using onClick method. When I get this selected item I need to show Toast ...
jenik2205's user avatar
  • 435
1 vote
2 answers
1k views

How to initialize viewHolder in RecyclerView adapter for Android in Kotlin

How should I initialize viewHolder? I have this error: What I want to do is to get selected item in recyclerView but without using onClick method. When I get this selected item I need to show Toast ...
jenik2205's user avatar
  • 435
0 votes
1 answer
335 views

recycler view is not shown in fragment

I changed my activity to fragment for some reason but now my recycler view is not shown I have also checked the ArrayList that I want to show on recycler view it was not empty. The same code is ...
mayra's user avatar
  • 71
0 votes
1 answer
110 views

I want my recyclerview to show limited cards through condition but all items keep getting shown

I'm trying to show a Recyclerview list of jobs that are not finished (!isJob_finished()) but every item seems to be shown in the recyclerview card list. How do I make it that when a job is not ...
Don'thavetHanswers's user avatar
0 votes
1 answer
496 views

Is it posible to change layoutmanager for a different viewtype?

Actually I have two viewtypes, a recyclerview is showing the elements in a gridLayout fashion. Problem is that one of those elements in the grid should be show horizontally with a linearlayout aspect ...
SNM's user avatar
  • 6,205
0 votes
2 answers
1k views

DiffUtil Not working in nested recyclerview Kotlin

I have two recycler views. My view is not updated until I used notifyDataSetChanged. I asked for a similar type of issue, but this time I have Github Link. So please have a look and explain to me what ...
Vivek Modi's user avatar
  • 5,619
0 votes
1 answer
836 views

getting data from room android with view

one week ago I learned the recycler view and work with me fine with adapter and fragment in the XML layout and with hardcoded data or in the shared preferences, but now I learned the room database I ...
Mamoon100's user avatar
1 vote
1 answer
862 views

RecyclerView scrolls when click on item Android

I have implemented RecyclerView with changing backround when clicked on an item. RecyclerView contains only TextView. Sometimes when I click on an item the recyclerview scroll little bit. Strange is, ...
jenik2205's user avatar
  • 435
1 vote
0 answers
119 views

How to show images of a single item in a ViewPager, does this require an adapter?

I have fetched a list of items from the Firestore and shown it in a recyclerView. Now when I click an item I want details (a few images and texts) of this particular item shown in a ViewPager. ...
Codist's user avatar
  • 749
0 votes
0 answers
101 views

Removing all items from recyclerview at ONCE on firebase ui

I can delete one at a time in the recyclerview but trying to figure out how to delete the entire element at ONCE in the recyclerview when the finished button is clicked. this is my first time making ...
kels_osas888's user avatar
0 votes
2 answers
991 views

DiffUtil redraw all items in ListAdapter Kotlin

I am using DiffUtil with ListAdapter in Android Kotlin. I am calling the data from the server in the onResume method. When onResume called every item whole data is redrawing the view. I want to update ...
Vivek Modi's user avatar
  • 5,619
0 votes
1 answer
554 views

Android RecyclerView MVVM where to update Adapter with notifyDataSetChanged

Where should I call any form of notifyDataSetChanged() on my adapter? The data source is populated asynchronously because I fetch the data from the web. The adapter belongs to the view. However the ...
SaPropper's user avatar
  • 493
0 votes
0 answers
402 views

Android Kotlin RecyclerView and menu item intent pass value to a second activity

I'm working on a simple task which presents a list using recyclerview adapter class class MedalAdapter(private val context: Context, private val datalist: MutableList<Medal>): RecyclerView....
Steven93's user avatar
0 votes
0 answers
131 views

RecyclerView Data Update During Async Filtering

I'm using Filter in my RecyclerView.Adapter . And the adapter data is updated every 30 seconds. The filtering process is handled in a background thread. If the dataset changes during filtering (ex: ...
M.Toy's user avatar
  • 103
0 votes
1 answer
85 views

Why isn't Android drawable showing up as list item background?

I cannot figure out why the drawable I'm using is not showing up as the background, with border, for list items. Here is the drawable in a file named ticketborder.xml: <?xml version="1.0" ...
David Rector's user avatar
  • 1,010
0 votes
1 answer
2k views

checked checkbox become unchecked in recyclerview after scrolling

I have a recyclerview with a list of items , when i check an item and scroll until the checked checkbox disppear , and scroll again to it , the checkbox become unchecked this is my adapter code class ...
Anas Hafidi's user avatar
0 votes
1 answer
501 views

custom adapter for spinner android kotlin not visible but visible when you click the dropdown values

I have a spinner containing items from a web service, the value is only visible on the dropdown only. when I open the app the spinner is empty but if I click the spinner I will see the values in the ...
wise4rmgod's user avatar
0 votes
0 answers
269 views

LayoutManager not setting stackFromEnd and reverseLayout Kotlin

inside an activity I have an observer I am calling a function to setup adapter. After that I am setting list to my adapter. And doing How to know when the RecyclerView has finished laying down the ...
Vivek Modi's user avatar
  • 5,619
0 votes
1 answer
117 views

Change layout Manager programatically in recylerview android

I want to change layoutmanager stackFromEnd and reverseLayout change when view is inflated. I have nested recylerview. So when recylerview inflated, i need to check that recylerview has more item than ...
Vivek Modi's user avatar
  • 5,619
0 votes
1 answer
1k views

DiffUtil not refreshing view in Observer call android kotlin

Hey I am using diff util with ListAdapter. The updating of list works but I can only see those new values by scrolling the list, I need to view the updates even without recycling the view (when ...
Vivek Modi's user avatar
  • 5,619
1 vote
2 answers
205 views

recyclerview item mishap(undesirable behaviour) in android studio

I have a recycler view with a list of items and each of those items have checkboxes attached to them. When a checkbox is checked, it behaves properly and there is no problem with unwanted items ...
Harshitha's user avatar
0 votes
1 answer
227 views

Remove certain items which are empty from RecyclerView list?

I'm making an app using TMDB API and have gotten stuck at a small issue. TMDB API shows seasons and episodes which are empty, basically, those are yet to air but since those are empty, the app shows a ...
Meggan Sam's user avatar
0 votes
1 answer
4k views

How to proper way of using Diff utils when updating view in adapter kotlin

Hey I am new in DiffUtil in adpater. I read some articles from stack overflow, google docs and some articles. I am trying to understand callback of DiffUtil areItemsTheSame and areContentsTheSame but, ...
Vivek Modi's user avatar
  • 5,619
-1 votes
1 answer
466 views

Kotlin Fragment RecyclerView Adapter ...trying to make ItemClickOnListener to work

This is making me go bananas !! Swear i will never eat bananas again !! I am trying work on a Kotlin/Fragment/RecyclerViewAdapter/OnItemClickListener but it is not working I am trying to make the ...
mukesh raj dass's user avatar
1 vote
2 answers
450 views

Swapping adapters inside the ConcatAdapter

I need to swap two adapters inside the ConcatAdapter but the list of adapters that is returned by getAdapters() is immutable and won't let me use the java.util.Collections utility. So far what I've ...
24hg824g2g4gh's user avatar
0 votes
2 answers
722 views

How can I call Main Activity Method in adapter class

This is My MainActivity where I have defined dataRefresh method that refreshes the adapter when data is inserted or deleted from the database public class MainActivity extends AppCompatActivity { ...
Mubashar Ali's user avatar
0 votes
2 answers
1k views

How to show or hide date textview when user scroll just like whatsapp chat android Kotlin

Hey I am working on chat application. I completed my incoming and outgoing message from How to use different layouts for incoming & outgoing chat messages. Also I tried this How to show date in ...
Vivek Modi's user avatar
  • 5,619
1 vote
0 answers
210 views

Fetching data from Firestore using FirestoreRecyclerAdapter

I started learning Firebase Firestore and this is my very first learning project. In a tutorial that I'm following, the tutor uses FirestoreRecyclerAdapter, but in my code it's showing an error that I ...
Dharmik 's user avatar
0 votes
1 answer
671 views

Response of a REST API into Fragment - Android Studio

I'm new in developing APP in android. I would like to develop an APP divided in fragment and each fragment is populated with datas obtained calling REST APIs. I followed different tutorial but I have ...
user3484121's user avatar
0 votes
1 answer
138 views

I cant open one fragmnet with recyclerview.adaper from another fragment with recyclerview.adaper

MainActivity class MainActivity : AppCompatActivity(), MovieListAdapter.ItemClickListener { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) ...
Oleksii 's user avatar
0 votes
1 answer
264 views

How to add items to desired ViewHolder position when using multiple viewtypes in RecyclerView?

I drew what I'm trying to implement. To explain the function, it is a workout log app. Image means that both RoutineItem and DetailItem can be added and deleted by button. (I didn't include a picture ...
ybybyb's user avatar
  • 1,545
1 vote
1 answer
55 views

Gridview highlight specific Item based on SQLITE status in Android

I have a problem in which I want to set highlight Gridview item when the value status from SQLITE is equal to 0. I have the query below but yet I don't have the idea where to start and how can I ...
Henry's user avatar
  • 167
-3 votes
1 answer
103 views

why recyclerview$adapter is null in fragment

This is my error code....... I'm trying to create a fragment to read contact s but when I run it it crashed.... But that not happen in activity... java.lang.NullPointerException: Attempt to invoke ...
Janith Anjana's user avatar
2 votes
3 answers
388 views

RecyclerView onCreateViewHolder and onBindViewHolder not getting called

I am trying to create a dynamic list view by getting data from SQLite Database. I created breakpoints and found out that onCreateViewHolder and onBindViewHolder of adapter files are not getting called....
Karthik Prakash's user avatar
-2 votes
2 answers
1k views

How to get the total count in cart using Recyclerview Adapter

Hi I am using Recyclerview with Adapter in my Android application. In my app I have product listing screen, where user can set the quantity in every list item. I am using two imageviews for increment ...
New Bee Andy's user avatar
-1 votes
2 answers
402 views

My app is crashing when i am trying to move from one activity to another activity due to java.lang.NullPointerException

This is my first android project. I don't know much about android development. Please give me a detailed solution. I am trying to move from my login activity to recyclerview activity but after ...
Deepak Chauhan's user avatar
0 votes
1 answer
480 views

Remove empty spaces from recyclerview

I have add an some condition in viewholder of recycleradapter of recyclerview to hide some items but it shows empty spaces of removed items in recyclerview which I hide how can I solve these problem ...
Ashish Dawkhar's user avatar
0 votes
0 answers
46 views

How to implement the reselection of android spinner

I am using a spinner with a custom adapter in my application. And depends on the selected item I want to call an API service. But API is not calling if I reselect the same item that is already ...
Malhotra's user avatar
  • 241
0 votes
2 answers
48 views

I want to call 'sentMessage' and 'phoneCall' method in my application but when we call these my application will be crash

/this is my main activity where we add picures, name and phone numbers of the different person....................................................................... package com.example.customlistview;...
Mubashar Ali's user avatar
0 votes
1 answer
381 views

Can ViewModel has static methods?

I have multiple Activities with the same CardView. To inflate this CardView I reuse the ViewHolder in my adapter. Now I'm trying to handle a click on the ViewHolder with setOnClickListener() and I ...
Simone's user avatar
  • 435
0 votes
2 answers
895 views

java.lang.NullPointerException null object reference viewpager

I am stuck while coding and need help on that. I am using view binding in my project. I have unable binding and that is working fine. I have used same code in my earlier project except view binding ...
Mohammad zeeshan's user avatar
0 votes
1 answer
873 views

Attempt to invoke virtual method 'java.lang.String com.practice.projectbm.Model.User.getName()' on a null object reference

enter image description hereI'm trying to get the data from firebase database which has child called EmailUsers which consists of name, email, bio etc. I want to display these items in my xml view. ...
Swaraj Hegde's user avatar
1 vote
1 answer
209 views

Why isn't the ViewPager infinite loop not working?

So I have this carousel project that shows a set number of pictures in a carousel way through a ViewPager. Before getting to this point, I had test the functionality of the ViewPager by manualy ...
OEThe11's user avatar
  • 351
0 votes
2 answers
430 views

Logic for items binding in RecyclerView in Kotlin

I would like to add some logic to item when binding in ViewHolder for RecyclerView. My Adapter looks like this: class MyAdapter(): ListAdapter<Item, MyAdapter.ItemViewHolder>(DiffCallback()){ ...
jenik2205's user avatar
  • 435
-1 votes
1 answer
1k views

How to fix android error: incompatible types: SliderAdapter cannot be converted to Adapter

I am trying to make an on-board activity in android studio. But I am facing a problem. This is my adapter code import android.content.Context; import android.view.LayoutInflater; import android.view....
Sam Viz's user avatar
  • 11
1 vote
4 answers
962 views

how to prevent android app crashing because of empty list on recycler view? [duplicate]

This is my Adapter class. when I open recycler view, if the list is null app crashes otherwise app run smoothly. I think I have to do something with the list. I mean if it's null do something that can ...
Steve Harrington's user avatar
1 vote
1 answer
799 views

Why does using footer LoadStateAdapter with RecyclerView and Paging 3 makes list open at wrong layout position?

The problem is quite simple: when I use an LoadStateAdapter (as a footer adapter), the RecyclerView opens the list from the wrong position. If I don't use adapter.withLoadStateFooter(footerAdapter) ...
MobileAppBrewer's user avatar
0 votes
1 answer
895 views

How can i add empty constructor to RecyclerView Adapter android kotlin

I need to add empty constructor to my Adapter, but i have already primary constructor. My code: class RvStatesAdapter(private var stateList: List<State>): RecyclerView.Adapter<RvStatesAdapter....
onesector's user avatar
  • 400
1 vote
1 answer
774 views

Recycler view not scrolling to last position

I'm having an issue maybe for misunderstanding how android recyclerview scroll works. I hope this can help the community too, and if you answer please provide information about the causes and fixes in ...
Àlex's user avatar
  • 674

1
3 4
5
6 7
68