Can anyone tell me what exactly does an array adapter do? I’ve tried searching the net but all I get is code examples. Please explain me what it does, I’ve visited the android developers as well.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
An
ArrayAdaptercan be used as a data source for a number of different Android Views, such as aListViewor aSpinner.Basically, you pass some kind of array or list to the constructor of an
ArrayAdapter. Then, the adapter can be hooked up to aListViewby calling setAdapter(). You can also use theaddandremovemethods of the adapter to modify the underlying list itself.You can also use an
ArrayAdapterto customize the appearance of items in aListViewfor example (or other Views) by using the constructor and passing in theresourceof a layout to use, or by overriding the getView() method and building it yourself.