Duplicate Classes to handle app flow (with explicit intents)

[postlink] https://the-best-way-of-life-is-islam.blogspot.com/2015/07/duplicate-classes-to-handle-app-flow.html [/postlink]

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?

اذا أعجبك الموضوع ساهم في نشره :

Enregistrer un commentaire

 
حقوق النشر: Published by | Template Created by | القناة على اليوتيب
copyright © 2014. The Best Way Of Life Is Islam -يمكن نقل كل ما هو موجود في موقع الرحمة تيوب
القرآن الكريم و الأحاديث النبوية أناشيد و دروس اسلامية منوعة موقع الفيديوهات الاسلامية
تطوير و تعريب مدونة ثعلوب