2

look at this code and tell if i use Arraylist whats happen ..i want to know whats a diffrent between ArrayList and Arrayadaptor?

public class structNote {
    public String  title;
    public String  description;
    public boolean done;
}

public class AdapteNote extends ArrayAdapter<structNote> {
    public AdapteNote(ArrayList<structNote> array) {
    super(G.context, R.layout.adaptornote, array);
}

1 Answer 1

1

ArrayList is list which holds list of int, String...

ArrayAdapter is adapter, which is used for Listing items in screen, like for ListView. It has more functions for that, if item removed in background, ArrayAdapter will remove it as well if you call adapter.notifyDatasetChanged(), it updates screen. You can not use ArrayList as adapter for Listing items on screen, but you can use it for holding list of items in memory.

Picture below ArrayAdapter holds items inside ListView. You can not use ArrayList for such listing.

enter image description here

Sign up to request clarification or add additional context in comments.

1 Comment

tnx for your answer ..my friend

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.