how to display an option menu when an activity starts - android

I've activity that i want an option menu to be displayed on. But, i want the option menu to be displayed all the time the activity is displayed. I don't want my users to click (select) the menu button to display it. I want it to be there all the time. How can i do it?
thanks

Activity.openOptionsMenu().
From a design standpoint, I have to agree with Mayra. Wrong approach to begin with.

If you want options to appear at the bottom of the screen always, don't use the options menu. Just place buttons at the bottom of your screen.
However, keep in mind that this goes against the "Android way" of doing things, so make sure you understand how Android users are going to expect your application to look and work, and you have a good reason for doing something different.

Related

Hint for DrawerLayout or MenuDrawer for new users?

I created some apps in which I used DrawerLayout or MenuDrawer and trust me some android users don't even know about drawers.
I need a reference of how to show them that they can swipe left or right to see the options that are hidden. Obviously HomeUp button doesn't give them a clue about sliding. I hope you understand my question.
A couple of ideas:
You can either begin your first launch with the app drawer open. The user would then need to close it and would know of its existence.
Again on first launch, you could animate a slight opening and closing, sort of a "jiggle" to hint that there's something there. Can I open the drawer layout with animation programmatically?
The official design guidelines suggest opening the drawer by default the first time the app is opened by the user. This is probably the least hostile option to users that are familiar with the drawer layout, which is going to be most of your users, but it still makes it obvious that there is a drawer and how it works.
It sounds like you want a reference for your users, to explain to the users how to get to these option pages. I've personally not had an issue with the drawer layout apps I've come in contact with, but I honestly can't remember if the first one might have had a little pop-up that explained "Swipe from the left edge for options, swipe from the right edge for tools" or some such.
But that is what I'd recommend: an FYI popup/alert with a "don't show this again" checkbox, runs once when the app opens unless they've checked the box.

Android menu chosing by pressing

I'm looking to do something on Android.
I want to press with my finger some image for like a second and make it appear a menu; however, I would still have to be pressing the screen while I move to the chosen option. From the moment I quit my finger from that option it would be the selected.
I've been looking for tutorial's and "how to"s but I can't have a clue on how to do that. I would appreciate some help in this topic
Thank you very much for your time
Its better to display the Context_Menu onLongClickListener and let the user to chose the option.
The idea of keeping the screen pressed its not really a good idea.
Most of the people are unaware of that. Whereas, if u just simply display a context menu and let user click the desired option, it will be better.

maintaining view state android

Please don't delete it because its a duplicate. I am an android developer with little experience. I have an app with 2 screens. The first has a bunch of options in a TableLayout each selected using a RadioButton.
What I want to do is, when I select one option and click a Button which appears below, the View should switch to the next screen showing some related data and when a Button is clicked I want it to come back to the same screen but then the rest of the options should be available to me so as to repeat the same process with another one of the options selected.
In short I want to be able to maintain the state of the first screen. I can't seem to be able to decide between using ViewSwitcher, ViewFlipper, or multiple Activities or using a single Activity which is what I am doing right now. But as my app gets bigger its very difficult to handle it. Please suggest the best way to do this. I am confused and desperately in need of help because my job depends on it. Thanks in advance
Use 2 activities. Launch the 2nd activity when the user clicks the button. When the user clicks the "back" button (or some other button you offer him) the 2nd activity finishes and the first activity (which was underneath it) is shown.
Note: You've not given us much information, so I can't guarantee that this is the best solution. From what you've said this is the solution I would recommend though. As they say in advertising "Your mileage may vary" ;-)

Click "More" in Android Option Menu

When there's more than 6 items in the Android Option Menu, a "More" will be in place. My question is currently I see two different behaviors upon clicking, from different apps. One will show a menu like this, another will show a context menu like this.
Which is one is the proper Android way?
Thanks
I don't see how those two are related. Your first link shows the options menu with "more", which is what you were talking about in your first sentence. The second link shows the context menu after a long press on a list item - that's a completely different item. They both have their uses.
The menu is used for options that are global to the current activity. The context menu is intended for options that relate to the specific item you picked.
If you see an app that uses a context menu for "more", then it's not using the normal Android menu system. I've even seen Google apps use that (Maps, I believe), and I don't know why you would do that.
The first is the "proper" way as in the default behaviour you get. I don't think the difference is meaningful, but to achieve the second the coder must have mucked around, and I don't think it's worth it..

Android with multiple content view at same time?

I'm very new to android and I am wondering how I can have 2 windows displaying content at the same time.
Here is an example:
I have a HorizontalScrollView at the bottom of the screen which houses the buttons for a menu. Above it, I would like a window(like a JFrame) that I can change depending on which button from the menu was pressed. The ScrollView menu must remain unchanged an exist as a separate entity(if you know what I mean).
How can I go about doing this? I don't want to have to draw the menu every time a user click a button and a new page is displayed. I have a feeling it has something to do with intents and Activities, but I'm not sure.
Hope someone can help me out.
Thanks.
I'm very new to android and I am wondering how I can have 2 windows displaying content at the same time.
Interpreting you literally, you can't, but that's because "window" does not mean what you think it does.
Here is an example: I have a HorizontalScrollView at the bottom of the screen which houses the buttons for a menu.
Get rid of it and replace it with an options menu, so your application blends in with the platform.
Above it, I would like a window(like a JFrame) that I can change depending on which button from the menu was pressed. The ScrollView menu must remain unchanged an exist as a separate entity(if you know what I mean). How can I go about doing this?
Option #1: Get rid of the HorizontalScrollView, use an options menu, and use separate activities for each "window"
Option #2: Use a ViewFlipper, with one child of the ViewFlipper for each "window".
Of the two, Option #1 will generally be much better, for memory management, state management, code complexity, and UI design.
Could TabLayout be your answer :
http://developer.android.com/resources/tutorials/views/hello-tabwidget.html

Categories

Resources