parameters - Paramaters with the same value - android -
i have listview shows paramaters. 2 of parameters returns same value? how can differentiate two? email , voucher.
voucherobj obj = new voucherobj(); obj.customerid=item[0]; obj.type=item[1]; obj.name=item[2]; obj.searchstr=item[3]; <---- same parameter obj.searchstr=item[4]; <---- same parameter obj.branch=item[5]; obj.issued=item[6]; obj.expiration=item[7]; obj.status=item[8]; obj.vouchername=item[9]; obj.employeeid=item[10]; items.add(obj);
voucher.class
public class voucherobj { public string customerid=""; public string type=""; public string name=""; public string email=""; public string voucher=""; public string branch=""; public string issued = ""; public string expiration=""; public string status = ""; public string vouchername = ""; public string employeeid = ""; public string searchstr;
}
if you'll have static amount of items, can declare searchstr
field of voucherobj
static array
fixed size. assuming you're storing string
s, be:
string[] searchstr = new string[10];
if number of items of field unknown, use more advanced data structure, instance:
arraylist<string> searchstr = new arraylist<string>();
afterwards can use method add value:
obj.searchstr.add("value1"); obj.searchstr.add("value2"); ...
Comments
Post a Comment