See this picture:
I am designing a sudoku in android, have done the layout like this, so 81 Editext is there. I want to get all the values in the Editext so its difficult to declare and mange 81 views in activity. Can you suggest me a method which is effective for processing my problem?
I would suggest you to use array of Edittext's like this
To get values use the same way take an array and save those values in array like this. use for loop and get the values from the textfields and save it in the 2d array as i have declared in values array. I suppose you know how to code the rest of the thing you really want to know please comment, I'll post the rest.thank u.. I hope this will help you.
You can try out this way:
I hope it will help you.
Create edittexts dynamically.
In every iteration you are rewriting the
ed
variable, so when loop is finisheded
only points to the last EditText instance you created.You should store all references to all EditTexts:
Now
allEds
list hold references to all EditTexts, so you can iterate it and get all the data.getting data
NOTE:
This is not results your design there may be some changes.but follow these procedure to get exact results. I think you must you use
two for loops
to get your edittexts in a gridview.