Code do not work - how do I create a custom adapter?

Error is that the thing CustomAdapter does not exist

So what I need to do

make a class

Can you tell me how

Or please code

everything does not come ready made try to search on google how to make a class and also search how do you make a custom adapter for gridview

I search on google how to make custom adapter for grid view and through that I create these all

Really cause the main thing you did not did. Read everything carefully

I merged your topics since it is about the same code.

3 Likes

There I got this from there @Aarush_Kumar
public class CustomAdapter extends ArrayAdapter<items> {

List<items> items_list = new ArrayList<>();

int custom_layout_id;

public CustomAdapter( @NonNull Context context, int resource, @NonNull List<items> objects) {

super (context, resource, objects);

items_list = objects;

custom_layout_id = resource;

}

Also that website is this

Try BaseAdapter instead of ArrayAdapter

1 Like
2 Likes

Is BAseAdapter add both Image and text

No, it lets you add image and text both in a view.
You will have to do something magical and return that created view in onCreate method.

1 Like

Means Is we add Image and text Both

Hello please reply Is we use both image and text

Can you tell me how

You are new to Java and trying to learn much at once, this isn't gonna help you.

Please please please help me