Issue
I have three different options in my app that allow the user through several of the same classes but at different times, ie
1) Sharing with friend:
MainClass -> InviteFriendOrGroup -> Sharing -> IM
2) Creating event with friends
MainClass -> InviteFriendOrGroup -> CreateEvent -> OpenEventsPage
3) Creating event with no friends:
MainClass -> CreateEvent -> OpenEventsPage
My issue is with the intents to allow for this navigation without so many duplicate classes. For example, in the InviteFriendOrGroup class, onListItemClick
method
Intent i = new Intent(getActivity(), SpecialSharing.class);
startActivity(i);
which means that only open 1) above is allowed. An easy solution is to make duplicate classes, but with the different intents in them, ie.InviteFriendOrGroupEvent, or InviteFriendOrGroupSharing....
But there has to be a better way?
Solution
You shouldn't duplicate the classes. Pass parameters using "extras" in the Intent
to control which options are available.
Answered By - David Wasser
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.