Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dilemna : prevent StackOverflowException or improve user experience?

In my application, I have 2 list activities which can start one or the other by clicking on their items.

|--Activity1--|           |--Activity2--|           |--Activity1--|
|   item11    | ->click-> |   item21    |           |   item21    | ->click-> ...
|   item12    |           |   item22    | ->click-> |   item12    | 
|   item13    |           |   item23    |           |   item13    |
|-------------|           |-------------|           |-------------|

So if the user clicks too much, he can fill all the stack and the system will throw a StackOverFlowException won't it ?

The solution I chose then was to tag these 2 activities with noHistory="true", but now I regret that the user can't navigate between these 2 activities with the back button.

Can someone help me to find a better alternative ?

Thanks in advance

EDIT: to be more comprehensive, let's explain what is this activity workflow goal :

I have a database which store a list of names linked to a list of days in a year. A name can be linked to multiple days, and same thing a day can be linked to multiple names.

the database schema 

|  names  |---< n, m >---|  days  |

So this activity workflow is a kind of database navigator :

  • Activity1 is the NameListActivity, it displays a list of names linked to a specific day.
  • Activity2 is the DateListActivity, it displays a list of days linked to a specific name.

When user clicks on an item (a name) of the NameListActivity, the DateListActivity is started with the list of days linked to the clicked name.
And same thing, when user click on an item (a day) of the DateListActivity, the NameListActivity is started with the list af names linked to the clicked day.

like image 733
tbruyelle Avatar asked Dec 10 '25 04:12

tbruyelle


1 Answers

So if the user clicks too much, he can fill all the stack and the system will throw a StackOverFlowException isn't it ?

No, it won't.

like image 134
CommonsWare Avatar answered Dec 12 '25 18:12

CommonsWare