I have this code which gets some data from a database

```
  public List<Objects> getAllObjects() {
        List<Objects> Objectslist = new ArrayList<Objects>();
        // Select All Query
        String selectQuery = "SELECT  * FROM " + TABLE_OBJECTS;

        SQLiteDatabase db = this.getWritableDatabase();
        Cursor cursor = db.rawQuery(selectQuery, null);

        // looping through all rows and adding to list
        if (cursor.moveToFirst()) {
            do {
                Objects object = new Objects();
                object.setId(Integer.parseInt(cursor.getString(0)));
                object.setName(cursor.getString(1));
                object.setUrl(cursor.getString(2));
                // Adding contact to list
                Objectslist.add(object);
            } while (cursor.moveToNext());
        }

```

In my MainActivity, I am getting it like this

```
  DatabaseHandler db = new DatabaseHandler(getApplicationContext());

                List<Objects> Objects = db.getAllObjects();
                DBadapter adapter = new DBadapter(getApplicationContext(), R.layout.grid_item_layout, Objects);

```

I am getting an error in my DBadatper, here

```
 public DBadapter(Context context, int layoutResourceId, List<Objects> listitem) {
        super(context, layoutResourceId, listitem);//error here
        this.layoutResourceId = layoutResourceId;
        this.mcontext =context;
        System.out.println("entering adapter");
    }

```

the error is: `Cannot Resolve method..`  

I guess because of the List object, but how to fix that?

adapter class

```
public class DBadapter extends ArrayAdapter<Listitem> {
    private static Uri[] mUrls = null;
    private static String[] strUrls = null;
    private String[] mNames = null;
    private Cursor cc = null;
    private Context mcontext;
    private int layoutResourceId;
    private List<?> listitems;
    public DBadapter(Context context, int layoutResourceId, List<Objects> listitem) {
        super(context, layoutResourceId, listitem);
        this.layoutResourceId = layoutResourceId;
        this.mcontext =context;
        this.listitems = listitem;
        System.out.println("entering adapter");
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        System.out.println("entering adapter1");

        View row = convertView;
        final  ViewHolder holder;

        if (row == null) {
            LayoutInflater inflater = LayoutInflater.from(mcontext);
            row = inflater.inflate(layoutResourceId, parent, false);
            holder = new ViewHolder();
            holder.imageTitle = (TextView) row.findViewById(R.id.text);
            holder.imageView = (ImageView) row.findViewById(R.id.imageView);
            row.setTag(holder);
        } else {
            holder = (ViewHolder) row.getTag();
        }
        Listitem item = getItem(position);
        System.out.println("item.getUrl() ");
        System.out.println(item.getUrl());
        Picasso.with(mcontext).setIndicatorsEnabled(true);
        holder.imageTitle.setText(item.getId());
        Picasso.
                with(mcontext).
                load(item.getUrl())
                .placeholder(R.drawable.logo)
                .fit()
                .noFade()
                .into(holder.imageView);

        holder.imageView.setOnClickListener(new View.OnClickListener() {

            @Override
            public void onClick(View v) {
                // TODO Auto-generated method stub

                Log.d("OnImageButton", "Clicked");
                Intent intnt  =new Intent(mcontext, SingleViewActivity.class);
                intnt.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
                //Bitmap imageID=holder.imageView;
                //intnt.putExtra("ImageId", imageID);
                mcontext.startActivity(intnt)  ; //This line raises error

                Toast.makeText(mcontext, "intent",
                        Toast.LENGTH_LONG).show();
            }
        });

        return row;
    }

    static class ViewHolder {
        TextView imageTitle;
        ImageView imageView;
    }

}

```

Objects.java

```
public class Objects(){
private int id;
private String name;
private String url;

public Objects ( String name, String url)
{
this.name = name;
this.url=url;
}
public Objects()
{
}
public int getId() { return id; }

public String getName() { return name;}
public String getUrl() { return url;}
}

```