I want to pass the data from the Activity containing a recyclerview to it’s recyclerAdapter class. I just want to use a String in the adapter but I don’t know how to get it from the activity. Is there any way to do this? Please keep in mind I want data from Activity to Adapter and not vice a versa
Tag: android-recyclerview
Why is the content of CardView inside a RecyclerView (in my case) changing when I scroll?
I have the same question like this post “Cardview’s data are changed while scrolling RecyclerView”. But taking out the statics isn’t working. Context of what I am doing: I am adding a couple of buttons inside a FlexboxLayout and again inside a CardView (CardView inside a RecyclerView). Buttons are being added dynamically. The same thing happens with a couple of
Getting Problem In RecycleView with TextInputEditText
I am a new Programmer, actually I was trying to make an app. I was trying to make an activity that uses RecyclerView to Show TextInputEditText with spinner and TextView. It means that I was trying to make an activity that uses Recyclerview and In the layout of Recycler View, I have used Text Input Edit Text and Spinner and
Error in displaying data with TextView.setText: Resources$NotFoundException: String resource ID #0x0
I am getting this exception: The exception stack trace points to this line in the adapter class: This is my adapter class: This is my POJO class: Answer You’re accidentally calling the version of TextView.setText that takes an int resource ID. You should explicitly convert it to a String:
Sum column SQLite Android and display on TextView
I have an SQLite DB in my Android Project. I have a RecyclerView for “Cart” Activity, where I display some items from this DB. Every item has its own “quantity” and “price”. What I want to do, is to create a method to display a total sum of elements (Total price = Elem1(quantity * price) + Elem2(quantity * price)+…) in
How to fix Scrolling issue of horizontal ViewPager2 and RecyclerView that are inside a vertical RecyclerView?
I have a RecyclerView (say, rootRecyclerView) that can have different kinds of rows depending on some API response. I implemented one of them is a horizontal ViewPager2 and another one is implemented with horizontal RecyclerView (say, childRecyclerView). The rootRecyclerView swipes vertically whereas the viewPager2 and childRecyclerView swipes horizontally. The Problem: When I swipe on the screen, if the swipe is
How to change RecyclerView LayoutManager from List to Grid?
I’m using a ViewPager in which I have a RecyclerView, in this RecyclerView I want to change the LayoutManager from List to Grid. I’ve implemented this code: On the RecyclerView’s onCreateViewHolder I have the following code: I make the change from List to Grid through a FloatingButton, changing the value of “managerL” (this is a boolean variable) so, when I
RecyclerView adapter not working with groupie
I tried to add groupie adapter to my recycler view as shown in the code below. However when i run my application, i get a compiler error saying my reyclerview cannot be null (because of kotlin null safe feature). I cant figure out why this adapter is not working. I know the problem is in the line : Here’s the
RecyclerView inside RecyclerView swipe to delete on child
I have a really basic concept and it’s probably a really easy solution that I am missing. I basically have a recyclerView inside a recyclerView. It works perfectly and everything is smooth. I recently decided to add a swipe to delete to the recyclerViews. The parent one (the outer most) works perfectly. However, when I try to do the exact
RecyclerView Item Click Listener the Right Way
I use RecyclerView adapter to display data inside an activity, I want to implement onClickListener inside the activity, currently, I am setting onClickListener inside adapter as usual which works fine. However I want to implement it inside activity so I have greater control. This doesn’t serve my purpose. I think it’ll be useful for a lot of us. Answer You