In my android app, I am creating the Textviews dynamically(in java code) and binding them to a TableLayout. I have an async Task, to continuously update every textview's text. I am changing the text of these textviews on click. On orientation change, I want to retain the text of all the textviews in the tableview. During creation, I am giving unique ID to each textviews, I don't want to declare onConfigChanges in Manifest(Bad aproach). Can not go with OnSavedInstanceState() aproach also, as there are many textviews. So, I am trying with async task in a fragment. Please help me, how to achieve this.
Asked
Active
Viewed 26 times
0
-
are you sure you don't want to use `ListView/RecyclerView`? – LordRaydenMK Jun 13 '15 at 12:18
-
See also http://stackoverflow.com/a/10259838/115145, http://stackoverflow.com/questions/15545211/how-edittext-retains-its-value-but-not-textview-when-phone-orientation-changes/26685777#26685777, and others – CommonsWare Jun 13 '15 at 12:19
-
I am sure LordRaydenMK. I dont wanna use Listview or Gridview or Recycler view. – Shivanand Darur Jun 13 '15 at 12:30
-
As I have mentioned, I can not go with onSaveInstanceState() and onRestoreInstanceState. Because, there are hundreds of textviews. – Shivanand Darur Jun 13 '15 at 12:34