android - How can I take values from EditText and sum them in array -


i have 2 edit-text example. wanna take value user entered on it. , sum them on array.

let code this.

edittext onevalue = (edittext)addview.findviewbyid(r.id.one); edittext twovalue = (edittext)addview.findviewbyid(r.id.two); 

if user entered 5 in onevalue, , 7 in twovalue. how can sum them in array ?

what mean "sum them in array"? if want add 2 values , add summed value in array can following:

int[] array = new int[10]; // size  int = integer.parseint(onevalue.gettext().tostring());  int b = integer.parseint(twovalue.gettext().tostring());  int c = + b;  array[0] = c; // position 

Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -