B4X FEED Preserving EditText State - Create/Resume/Pause

اطلاعات موضوع

درباره موضوع در تاریخ, در دسته b4xfeed ایجاد شده و آغاز کننده آن practicalsoftمی باشد و موضوع آن: Preserving EditText State - Create\/Resume\/Pause است. این موضوع تا کنون 36 بازدید کننده و, 0 پاسخ داشته و 0 بار پسندیده شده...
نام دسته b4xfeed
نام موضوع Preserving EditText State - Create\/Resume\/Pause
آغاز کننده موضوع practicalsoft
تاریخ شروع
پاسخ‌ها
0
بازدیدها
36
پسندها
0
آخرین ارسال توسط PracticalSoft
Jun 6, 2020
11,559
4,422
I have a single activity app with four EditText fields. To enhance the user experience the content of each view (and cursor position) must be preserved every time the app goes to the background or terminates. Easy enough I thought.... use KVS to save and reload the fields every time the app Resumes or Pauses.

This method does most of the job as when the app is simply sent to the background it can be recalled by the user and sure enough the focus remains with the last used EditText. Unfortunately as I have re-populated the EditText.Text from KVS in the Resume Event it is repopulated correctly but the cursor is repositioned to the beginning of the field instead of where the user left it.

What is the smartest method of restoring each of the four EditText fields exactly as the user left them in terms of content and focus whilst catering for the Create/Resume/Pause/OS terminate lifecycle?

 

عقب
بالا