0

I have a page that list a current list. The user then clicks the floating + to add an item to this list and go through a wizard and then when they are complete, it redirects them back to the current list. I noticed that if I hit the back button, I go straight through the wizard again and back to an outdated list(instead of a current list).

I am wondering how people deal with user experience. If they land on the main page, I would simply (I think) like to just wipe the history as it is not useful at that point and more confusing than anything.

I am curious on

  • How to wipe the entire history
  • Is there other UX options that make sense to users
Edric
  • 24,639
  • 13
  • 81
  • 91
Dean Hiller
  • 19,235
  • 25
  • 129
  • 212

1 Answers1

0

Check out this question and answer. Android: Clear the back stack. It will help you with your "history" (referred to as the back stack).

It should also fix your issue if the outdated list, however, I'm also questioning your method of adding an element to a list that results in an outdated list being shown when going back in the stack. If your data is properly managed, that shouldn't happen ever. To me it sounds like you are passing a list as an extra to an activity and setting a member variable in the activity class with that list. Or you have a static list somewhere and you only loop over it to create elements to display in the onCreate of the activity. Either way, it is a bad practice. The view should be notified of updates to the model. Look into the MVVM (model–view–viewmodel) design pattern or the MVP (model-view-presenter) design pattern for ideas of what this means. Ideally if you are displaying dynamic data in a list, you should be using either a list view or a recycler view both of which need to be notified of changes to update.

undermark5
  • 775
  • 6
  • 17