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

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -