Answer the question
In order to leave comments, you need to log in
Why do you need an adapter in Android?
I'm reading about Android here and I don't understand why adapters are needed? Those. I understand that it binds data and objects, but what is the practical need?
Here I need to display a list with icons, some text and other data. I make a separate layout (xml), take an inflater and output everything I need in a loop.
Yes, the same thing can be done through adapters, but I don’t understand why? Just as an alternative way to output data?
PS Read about adapters here: startandroid.ru/ru/uroki/vse-uroki-spiskom/109-uro...
Here about inflater: startandroid.ru/ru/uroki/vse-uroki-spiskom/81-urok...
Answer the question
In order to leave comments, you need to log in
Inflater is used to simply get a View as an object from an XML file.
The list adapter is used to process the data to display it in the list.
They have different areas of application.
Why would you torture yourself and the system with something that Android has long taken care of?
You can get a view in your adapter using an inflater and once showing what and where from the data you need to put, get a full-fledged list with preference and courtesans, instead of a simple view list that you wanted to get in a loop.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question