android - Duplicate Classes to handle app flow (with explicit intents) -
i have 3 different options in app allow user through several of same classes @ different times, ie
1) sharing friend:
mainclass -> invitefriendorgroup -> sharing -> im
2) creating event friends
mainclass -> invitefriendorgroup -> createevent -> openeventspage
3) creating event no friends:
mainclass -> createevent -> openeventspage
my issue intents allow navigation without many duplicate classes. example, in invitefriendorgroup class, onlistitemclick
method
intent = new intent(getactivity(), specialsharing.class); startactivity(i);
which means open 1) above allowed. easy solution make duplicate classes, different intents in them, ie.invitefriendorgroupevent, or invitefriendorgroupsharing....
but there has better way?
you shouldn't duplicate classes. pass parameters using "extras" in intent
control options available.
Comments
Post a Comment