java - ImageArray not populating when the fields are passed to it -
so have imagearray finds 17 fields. not populate them array @ end. says image array empty. debugger shows log populated 17 fields database. array fails include them @
imagearray.add(rn);
java oncreate
@override protected void oncreate(bundle savedinstancestate) { requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); super.oncreate(savedinstancestate); setcontentview(r.layout.activity_myreceipts); receiptsoperations ro = new receiptsoperations(this); list<receipt> receipts = ro.getreceipts(); for(receipt rn : receipts){ string log = "receiptid:" + rn.getreceiptid() + "receipturi:" + rn.getreceipturi(); log.d("result: ", log); imagearray.add(rn); }
receipt list initialised
public list<receipt>getreceipts() { // code retrieve images database. list<receipt> receiptlist = new arraylist<receipt>(); string selectquery = "select* receipts_table order receipt_id"; // check rows , add list. sqlitedatabase db = this.getwritabledatabase(); cursor cursor = db.rawquery(selectquery,null); if(cursor.movetofirst()) { { receipt receipt = new receipt(); receipt.setreceiptid(new string(cursor.getstring(0))); receipt.setreceipturi(new string(cursor.getstring(2))); receiptlist.add(receipt); } while(cursor.movetonext()); } db.close(); return receiptlist; }
Comments
Post a Comment