Tartar Tartar - 12 days ago 6
Java Question

How Android Custom Adapter works?

I'am trying to use a custom listView in my application and i have some questions about its working principles.When i implemented a custom adapter,how its methods(especially the getView method)work without calling them from any other class ?

Answer

I think this link can help you. getview is a callback function which will be called automatically when you will display your listview on Activity. When you display your listview then you overrides getview and inflates your row from XML or dynamically creates your row. That row you return as a view which displays in your listview.

How does the getView() method work when creating your own custom adapter?

For each row getview will be called once. You create your layouts and return them as view. Those respective views displays in your lisview rows.