3,391 questions
0
votes
0
answers
6
views
how to adjust the position of the viewpager when opening the application
How do I display the initial position of the viewpager as desired when opening an application, such as TikTok?
Example my application
expected example, can open the page as desired
I'm confused about ...
0
votes
2
answers
56
views
public void onBindViewHolder(MyViewHolder myViewHolder, int position)
Help me, i dont know why it is still get the error: Do not treat position as fixed; only use immediately and call myViewHolder.getAdapterPosition() to look it up later
Here is my code
public void ...
0
votes
2
answers
47
views
Android recycler view not calling any function (Kotlin)
I have a simple new application with a recycler view that should display "songs" but at the moment it displays non.
Non of the functions on the adapter are being called, not even ...
0
votes
0
answers
21
views
Unable to play same item in Media Recyclerview
I have media items which are mp3 in recyclerview mp3 are stored in raw. Everything is right but when I try to play the same item again it won't play. Here is how it goes:
Play any item from ...
0
votes
0
answers
30
views
How to achieve Gemini Recycler View Effect that only shows the latest two components in RecyclerView?
I want my RecyclerView to display the latest message at the top of the visible screen, pushing the rest of the components up. Only the most recent component should be fully visible below it, similar ...
0
votes
0
answers
14
views
Dirty item view being used twice in my custom implementation of BaseAdapter
In my custom implementation of BaseAdapter I have views being hidden and overwritten on the basis of their position. One such condition is based on the last element(The ID will always be -1):
if(...
-1
votes
1
answer
39
views
Adapter not called when working with RecyclerView in Kotlin
I have a an Activity called ShoppingListActivity. The only thing it has in its layout is a fragment called ShoppingListFragment. That fragment get a listId as a parameter and should list all items ...
0
votes
0
answers
36
views
Adapter not attached recyclerview
I am trying to make a storytelling application that lets you see other's post, taken from a dummy API, but i just can't get the recyclerview list to work, as it only ever give me error, saying the ...
1
vote
1
answer
26
views
Adapter does not render elements in recyclerview, without errors in logs
Adapter does not render elements in recyclerview, and there are no errors in logcat.
I changed the background of the recyclerview and I know that it is displayed, but the elements that I add to it do ...
0
votes
0
answers
45
views
android-based ordering app java firebase: can't fetch data of seller in user dashboard
I have two userType (user and seller).The issue is that i can't fetch the data of seller in user recycleview or in any textview.
Example: in recycleview i have cardview and it contains textview (...
0
votes
0
answers
72
views
Recyclerview columns same width (not fixed) but take as much space as needed
I've been at this problem for over a month now. What I want is simple. I want like a table where each column takes as much space as is needed for the other columns in the other rows. So in the picture ...
1
vote
1
answer
67
views
Android Studio - Java - Difficulty Highlighting ListView Item Background Color
Introduction:
I am encountering an issue with highlighting the background color of ListView items in my Android application. Despite my attempts to modify the background color programmatically, the ...
0
votes
0
answers
77
views
Can I force the RecyclerView Adapter to bind ViewHolders for two more items?
I'm developing an Android application with RecyclerView. The Layout manager type is GridLayoutManager, the list items are arranged in two columns.
val products = listOf (
Product("Product 1&...
0
votes
1
answer
40
views
RecyclerView is not show last row of list
When I use condition to set text item in my recyclerView Adapter then last row is not shown? I dont know how to do that
please help me.
class ShopCategoriesAdapter (var list:List<CategoryModel>) ...
0
votes
2
answers
67
views
Adapter with multiple items using getItemViewType
I have a contact list that are separated by group header. So I have used getItemViewType in my adapter :
@Override
public int getItemViewType(int position) {
ContactItem contactItem = ...
1
vote
1
answer
41
views
Why is my RecyclerView showing the list duplicated?
I have an Activity with a RecyclerView that gets a list of objects from my Fireabase Database. Until this point everything works as expected.
On the adapter I have a button do delete one object. This ...
0
votes
1
answer
37
views
Recycler view not updating item after editing it
On my Android application I have a RecyclerView with a list of objects from a class called Apiario. In each item of the list I give the option to remove that item or to edit one of its variables. I ...
0
votes
1
answer
33
views
Multiple time call onBindViewHolder method when firebase Documentlistener call in this method in kotlin(infinite call)
This is adapterclass of Reyclerview My question is when I am calling firebase document in onBindViewHolder method it callining infinte loop due to call back of addSnapshotListener becuse I need to ...
0
votes
1
answer
92
views
List Adapter doesnt get updated after updating an item in dataBase
I'm writing a note app with RoomDB and when I try to update an existing note it updates prefectly in the database but i have to either restart the app or open another fragment and then com back for ...
0
votes
0
answers
785
views
libart.so art::gc::Heap::WaitForGcToCompleteLocked(art::gc::GcCause, art::Thread*)
Title Issue:
The primary problem lies in the title.
Second Issue:
There is an issue related to [libart.so] art::gc::Heap::WaitForGcToCompleteLocked.
Context:
I am utilizing an adapter with a cursor ...
1
vote
2
answers
64
views
Why does my RecyclerView scroll properly but NOT perform onItemClick method?
I am working in Android Studio on a Kotlin project. I have defined my own Adapter and implemented a RecyclerView in my Activity. The RecyclerView populates the data correctly and allows me to scroll, ...
0
votes
1
answer
73
views
Viewpager Transition not smooth for ImageViewer when swiping up or down
I have a transition effect to swipe from one image to the next and to the previous one. The swiped image is beeing moved outside of the screen an the previous/next image enters form the opposite side ...
0
votes
1
answer
46
views
How to randomly choose any 4 key-value pairs from the singleton class in kotlin to display them in Fragment?
I have created a singleton class where I have written 'n' number of key-value pairs, in which the values are Pair like below. My issue is, when I initially open this fragment, it displays 4 different ...
1
vote
1
answer
109
views
The data from SharedPreferences doesn't update unless I scroll down the RecyclerView Android Kotlin
The problem is that when I click the "Add to Favorites" button for the first time, the image changes and the data is saved to SharedPreferences. However, when I click the same button again, ...
0
votes
1
answer
47
views
No item selection in RecyclerView
I have made a vertical recyclerview in my program. When i click on any recyclerView items i don't see the on click listener working. Here is my code for the Adapter class:
class BoardItemsAdapter(...
0
votes
0
answers
47
views
How to change background color of single item Recyclerview (Kotlin)
My Category data class:
data class Category(val category: String)
This is my category Adapter:
package com.example.store
import android.graphics.Color
import android.util.Log
import android.view....
1
vote
1
answer
42
views
position doesn't work depends on getItemCount in RecyclerView (Kotlin)
override fun getItemCount(): Int {
return ekipListesi.size
}
override fun onBindViewHolder(holder: KisilerVH, position: Int) {
holder.binding.kisiAdiTextView.text = ekipListesi[position]
println(...
0
votes
0
answers
62
views
Why android Recyclerview automatically update without adapter notifyDataSetChanged() method called? when data is coming from web socket background
I am showing list of data by recyclerview. so when data is comming from web socket then adding new items in existing list so my recyclerview update automatically. i am not explicitly calling ...
0
votes
2
answers
55
views
MVVM- check updates with Recyclerview adapter
I am having hard times understanding updating my recyclerView- Adapter items with a Live-Data<List<SomeObject>>.
Let's say I have a RecyclerViewAdapter in my Fragment which I initialize ...
0
votes
2
answers
42
views
Why are all the images not coming to first column and the textviews two second column in android?
So, i have a list of images and another list of names of those images. I want to display all the images one below other in cardviews of first column and all the names one below other on cardviews in ...
0
votes
2
answers
211
views
How to correctly pass a list to Adapter from the Retrofit Response? [Android Studio 2023]
So, I have followed many YouTube tutorials to correctly learn about Retrofit in Android and how to pass data from the response to my adapter and display the list but none of them is working for me ...
0
votes
0
answers
18
views
Error in fetching data using FirestoreRecyclerAdapter in recyclerview crashing app
im developing a Rent car app uising firestore database when i use simple adapter it fetch data correctly from firestore but when i use FirestoreRecyclerAdapter the app crashes. I badly need to use the ...
-2
votes
2
answers
56
views
How to show distance between two locations in recyclerview items?
I have two classes User and School as follow:
User: name, age, latitude, longitude
School: name, latitude, longitude, level, address, rating
And I have an adapter for lists of schools that comes from ...
0
votes
0
answers
96
views
Kotlin gridView is not displayed in fragment
i would like to use a grind view in a fragment but i couldn't find how to do it. so i tried to adapte the way i did it in an activity but even if i don't get a crash, the grid is not displayed. Here ...
0
votes
0
answers
37
views
Why do i lose values after scrolling in Recycler View?
Whenever I add multiple items, for example more than 7 and that's scroll to the top. The top items are lost. When I go back down the bottom items are also lost
After entering the data, if i scroll ...
0
votes
0
answers
50
views
How to make checkbox selection in a dialog with RecyclerView affect only the current row in the parent RecyclerView?
I have a parent recycler view with multiple items and two buttons for each view. If I click the button that I have highlighted, a dialog with another recycler view pops up which has checkboxes ...
0
votes
0
answers
119
views
How to create one horizontal and one vertical RecyclerView with headings in a parent RecyclerView using Kotlin?
I am currently using one recycler view which is Parent and vertical scrolls in home fragment, I search through resources but as learner I cant find anything useful, I WANT TWO RECYCLERS_VIEW WITH ...
0
votes
1
answer
210
views
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 occuring in my Activity's Adapter
When I started the MainActivity, my app crashed and returns the error : java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 on my stack trace.
Here's my adapter code:
class MainAdapter: ...
-1
votes
1
answer
27
views
Delete an view from the MainActivity
I have a recycler view app in which it takes data from user and set it on a recycler view I want that when user will click on that view an alert dialog box will open and it will ask that should he ...
0
votes
1
answer
28
views
RecyclerView isn't displaying any items
My recyclerView isn't displaying any items. I'm not getting any errors though so I'm not sure what the problem is. Here is the code.
MainActivity.java
package com.example.recyclerviewexample;
import ...
0
votes
1
answer
315
views
Can someone tell me why it gives me an error when I try to use "absoluteAdapterPosition" in a Recycler View in Kotlin?
It tells me there is a mismatch, it requires "AdapterView<*>! but it has found "Int". How do I fix this?
class InstructorViewHolder(itemView: View, listener: OnItemClickListener) ...
1
vote
1
answer
33
views
Getting this error - java.lang.llegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at line1 column 2 path $
I've also tried to do this api calling by using DiffUtil but the error remains the same and i keep getting this error java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BEGIN_ARRAY at ...
-1
votes
1
answer
50
views
My app is Crash when i'm Selecting the song, how to solve this
This is my music adapter file
and this is logcat error
at com.example.apna_music.MusicListAdapter$1.onClick(MusicListAdapter.java:57)
at android.view.View.performClick(View.java:7570)
at android.view....
0
votes
2
answers
52
views
Andriod - RecyclerView not printing items as expected
I have a bug RecyclerView where items are not coming as expected.
RecyclerView is using multiple ViewType (Category and items) but
Currently, The adapter is printing items like this. (The Category &...
0
votes
2
answers
1k
views
RecyclerView with CheckBox does not keep selected items
I have a list with RecyclerView + Adapter + ViewHolder and each item list contains a description and a CheckBox. If I select an item and scroll down the list RecyclerView does not keep the selection ...
0
votes
1
answer
86
views
Is there a way I can setAdapter and setMessage at the same time for MaterialAlertDialogBuilder?
I want body text to appear above a list of views inside dialog from MaterialAlertDialogBuilder. I tried setting body text and adapter but it only resulted in showing the body text, ex1.
...
0
votes
1
answer
153
views
How to show Interstitial ad after 3rd post in Android Studio?
i am making app with Android Studio using Wordpress as backend and fetching posts via json api .. now i want to implements AdMob interstitial ads in my app but don’t want to show ads for every post ...
0
votes
0
answers
24
views
Unable to populate listview fragment from array of string
I am unsure where I am going wrong. I have used an array before to populate a listview and had no issues. Now that I am using a fragment I receive errors that I am unable to fix. I log to find where ...
0
votes
0
answers
17
views
RecyclerView content disapears on device rotation
Im doing an activity to show a profile that contains some cards with sports related to it, the idea is to see three cards at a time and be able to scroll the cards to see the next ones.
This is the ...
0
votes
0
answers
30
views
Variable 'singleChoiceAdapter' is accessed from within inner class, needs to be final or effectively final
I created a function with name setRecyclerViewSingleItems so that i can restrict the user to select only one option from the given options ( those options are stored in arrrayList ). I want to create ...