How is it possible to get "getText()" from child of type TextView within a custom ViewGroup at runtime?
Asked
Active
Viewed 1,580 times
1 Answers
6
((TextView)viewGroup.getChildAt(indexOfTextView)).getText();
Where viewGroup
is the ViewGroup containing the TextView and indexOfTextView
is the index in that group.
Make sure to cast the view returned from the getChildAt method to A TextView before calling getText().
ViewGroup Docs for getChildAt() http://developer.android.com/reference/android/view/ViewGroup.html

Spaceman Spiff
- 934
- 1
- 14
- 32
-
Great! I removed "viewGroup." and its working. Thanks – Ajay Aug 06 '14 at 21:29