Android : get the value of edittext in the tablerow

Go To StackoverFlow.com

1

I have a table layout called tab to which i'm adding dynamic tablerows. Each tablerow has an edittext with values set from the database, and a textview. On page load the focus is set to the first edittext. How do i retreive the value of the edittext which is focused?? I tried this : tab.getChildAt(0).requestFocus(); then I tried to retrieve the value using tab.getFocusedChild().toString(); The result in my logcat is something like this: Focused Location ===== android.widget.TableRow@44ecada8

2012-04-04 05:46
by user1311991


4

You can try this

TableRow row1= (TableRow)tableLayout.getChildAt(rowPosition);
EditText et=(EditText ) row1.getChildAt(0);
String text=et.getText().toString();

Hope this helps you

2012-04-04 06:07
by Nishant
Ads