java - Getting text from inside editText that is contained in a Recyclerview -
i have recyclerview contains edittext, when button pressed outside recyclerview, retrieve text each view inside recyclerview. can't seem find best way that. have tried use callback, , have tried external class store data both ways seem should work have not had luck either. best practice geting text out of each edittext indivdual can added array or database.
in recycle view, list view etc, there view recycling mechanism reduce memory consumption.
so iterating through recycle view childs won't give whole data.
for example if there 10 items in recycle view , if 5 items shown on screen, if go iterating through recycle view childs, data associated few children, 6 or 7. because others view reused.
so in case need save data edittext model or bean class @ time of view reusing in recycle view adapter. when button clicked, can iterate through childs , data , put data again model or bean class. bean list can whole edited data.
Comments
Post a Comment