Questions tagged [android-adapter]

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

An Adapter represents the connection between a View with some kind of data source. Adapters generally come in two flavours: those representing array/list based data and those that represent Cursor based data.

  • The Adapter provides access to the data items.
  • The Adapter is also responsible for making a View for each item in the data set.

See Adapter reference for more information.

Tag Usage:

3394 questions
0
votes
1 answer

What can I use instead of orderbykey()?

I am using firebase realtime database in my application. I am pulling data with custom adapter in the message box. I want it to fetch old messages when I press the button. But orderbychild and orderbykey are not used together. What can I use instead…
0
votes
1 answer

How to play media player based on list index?

I have a song list and I want to play it in order. So after the song ends, it plays the next song. Here's what I try so far in my MainActivity.kt override fun onCreate(savedInstanceState: Bundle?) { var flag = 0 //play the first song …
0
votes
3 answers

Why submitlist didn't show the list when run the app? [Kotlin]

I am trying to display recyclerview list data using adapter. So far there is no error and I think my code logic is correct, but it didn't show the list when I run the app. Below is my MainActivity code override fun onCreate(savedInstanceState:…
0
votes
3 answers

What kind of parameter that can pass variables inside a Unit in Kotlin?

I am confuse about what kind of parameter should I pass from the main class to the recycler adapter class that have parameter type like this class RecyclerAdapter(private val clickListener:(view: View, movieName: String) …
0
votes
0 answers

No live data to adapter Firebase

I am using firebase realtime database in my application. I am pulling data with custom adapter in the message box. Data is showing. But if there is a new data in the message box, I cannot see that data. I have to exit the message box or refresh the…
0
votes
1 answer

News are not updating In recyclerView when I edit word in search edit text

I am developing NewsApi app. I set a search edit text for searching through articles, but the search works only for the first time. When I write another word in edit text recyclerView still shows articles related to the previous word. Please let me…
0
votes
2 answers

Add TextView programatically to a layout in onCreateViewHolder

I am new to android developemnt. I have a adapter class where currectly, in onCreateViewHolder method, a fragment(XML) is displayed. I want to add a textView to this fragment only if a 'if condition' is met. This is what i have but I am getting null…
0
votes
0 answers

Scroll to Expanded RecyclerView Item

I'm trying to scroll to a recycler view item if the item is expanded and/or clicked. I know that binding.recyclerview.layoutManager.scrollToPosition() can achieve this but I can't call the recycler view in the adapter class. Can I pass a boolean and…
sam_1234
  • 117
  • 12
0
votes
1 answer

How to get the image and text from a view in the recyclerView?

I researched around 20 - 30 answers and still not found a working way to: get the image and text from --> view --> viewHolder --> recyclerview --> Fragment ( one image and one text fills 1 screen). ( NullPointerException) I need them as quote:…
0
votes
1 answer

Adapter Class that extends RecyclerView for Two RecylerVews in Java Android Studio

My Layout Design is this The Code Function well but I want to know if there's is better way I can do this. My fist adapter: private Context mContext; private List directorsList; public MyAdaperD(Context mContext,…
0
votes
0 answers

Parse JSON array in Navigation Fragment Menu Items

I asked a question that how to parse JSON data in fragments. But anybody didn't give me a suitable answer. Dear friends, in my app I have done all coding but I am unable to fix the main problem in the Quotes fragment. private void…
0
votes
1 answer

adapter.notifyItemChanged(position) has no effect

For each item of the list ("itemList") ArrayList itemList = new ArrayList<>(); shown by "recyclerView" that is controlled by "itemAdapter", its quantity is displayed, as well as a plus and minus button which allows the user to respectively…
0
votes
1 answer

how do i access getParentFragmentManager() from inside an adapter

am trying to send a one time data from one a recyclerView adapter to a fragment in order to check which button was presses. according to the official documentation for this case it is best to use a getParentFragmentManager() method to interact with…
user19595313
0
votes
0 answers

check if the chat message is delivered firebase android

I have a messaging app. I am using firebase real time database in my application. Sometimes messages are not delivered instantly due to internet speed. When this happens, I want the user's message to appear on the screen with a dark background. When…
0
votes
1 answer

No adapter attached; skipping layout / on a null object reference

I was following a tutorial about a comic reading app, and while almost everything works, the last part of my code does not work, it says that my RecylcerView has no adapter attached to it, but it does, and because of that my textview cant be set…
NuiDev
  • 131
  • 1
  • 9