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 strings, 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

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -