Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First, you can't have an <code>Activity</code> inside another and activities are completely different from views as stated in the <a href="http://developer.android.com/reference/android/app/Activity.html" rel="nofollow">docs</a>:</p> <blockquote> <p>An activity is a single, focused thing that the user can do.</p> </blockquote> <p>Now, to answer your question, it all depends on how you want your app to behave. You could have your activities with the sliding menu implement the <code>onClosedListener</code> and switch to the selected activity from there. This will give you the animation of closing the menu before switching activities. It will also give you a weird effect since every time you select something from your menu you'll see the animation of a new activity coming to the front. </p> <p>I think the best approach would be to have a "common purpose" between all your sliding menu options. For example, in one of my projects I have to allow the users to select between lists of different types of data. When the user selects anything from the menu, I load a new list fragment into the right corner where he may choose the item he wants to view or edit. That's the app entry point and also the only place were I have a sliding menu in my app. It is pretty much the same for every app that implements this UI design pattern. Look at google+, currents and youtube where the side menu lets you choose which feed or content to show. Once a user makes a selection, just open a new activity for the selected item (a g+ post, a video, a news article, a tweet or whatever it is).</p> <p>Your app doesn't have to have lists of different data or anything like that to use the sliding menu, but keep in mind that the activity with the sliding menu should have a clear, focused goal with respect to its functionality and purpose. Having a sliding menu because many other apps have one is a bad choice, you should use it with a specific objective. Also keep in mind that applying the sliding menu everywhere would interfere with the platform's <a href="http://developer.android.com/design/patterns/navigation.html" rel="nofollow">navigation pattern</a> and lead to an overall bad user experience since it wouldn't behave as the other apps.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload