SQLite get all data and pass it to an Adapter

后端 未结 3 1964
离开以前
离开以前 2021-01-13 17:58

I have this code which gets some data from a database

  public List getAllObjects() {
        List Objectslist = new ArrayList&         


        
3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-13 18:35

    Try to look at the difference between what have you done and what you need to do.

    public class DBadapter extends ArrayAdapter {
    
        List modelItems = null;
        Context context;    
        public Resources res;
    
    
        public DBadapter (Context context,List resource) {
            super(context,R.layout.grid_item_layout,resource);
            // TODO Auto-generated constructor stub
            this.context = context;
            this.modelItems = resource;             
        }
    
    
    

    Hope it will help you.

    提交回复
    热议问题