英文:
Saving value from 2nd activity to 1st without losing the updated data
问题
这个应用有2个活动。主活动显示4个图像,作为图像按钮。当用户进入表单页面时,用户可以编辑图像的信息。然而,当我编辑另一个图像然后返回到第一个图像时,信息并没有保存。
希望能得到对此的任何帮助,将不胜感激!
英文:
This app has 2 activities. The main activity shows 4 images as image buttons. When user gets into the form page, user can edit the information of the images. However the info does not save when I edit another image and then return to the first image.
Any help to this would be very appreciated !
答案1
得分: 2
如果您只想从活动中检索更新后的数据,最简单的解决方案是创建一个类来保存常量,并在编辑数据时更新这些常量,当您希望获取更新后的数据时,只需从该类中调用这些常量变量。
英文:
If you just want to retrieve an updated data from an activity than easiest solution is to create any class to save constants and update that constants while editing your data and when you want an updated data just call that constant variables from that class.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论