Android menu chosing by pressing - android

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.

Related

How to build a random button picker with the blocks in app inventor 2?

I am a beginner and I don’t have any experience with coding etc. and I need help
The first screenshot:
shows my screen, and as you can depict from it there are two buttons- the first one is called RIGHT BUTTON, and the other one is called WRONG BUTTON. This is because clicking on the RIGHT BUTTON will open a next screen, whereas clicking on the WRONG BUTTON will result in going back to the previous screen. I thought that this is kind of boring :D that’s why I want to build something with the blocks that would choose randomly one of those buttons to be right and the other one to be wrong after the screen has initialized. To make it more clear. Every time I start the app I don’t know which button out of those two will take me one screen further- it could be the first or the second button- I want this to be a random pick.
Now, I have tried to build something like this blocks:
but I can’t find a suitable block, as you can see in screen shot 2 :D I assume, that this isn’t the way it should look like, but my skill is too low at the moment. I also assume that I will need an "if,then" block" I would be really grateful if someone built it and made a screenshot and post it here ;)
Basically, I am kindly asking for help. I have been looking on the internet for a tutorial etc. but I couldn’t find something that would really help me.
Thank you very much in advance ;)
When the button is pressed, instead of opening the next/prev screen, instead call a custom procedure and have that procedure decide if it was the right button to press or not. This can be done several ways, for instance with the Math.randomInteger block. You don't actually have to decide if it was the right button or not before the button is pressed, just do a "coin flip" at the time of the button press to decide (at least that's what it sounds like you wanted from your description).
Also note that the number of screens in AI is highly limited, and instead of going to another screen, you can just reuse the same buttons over and over (and maybe just show a label in the corner counting how far you've come), or make lots of buttons and only have the first two visible at the start, then as you progress hide/unhide the correct buttons.
Here this is the answer I have found for my problem using your info

Best method to have a popup menu in Android

I need help as I am a bit stuck.
I want to know what is the best method to implement for what I want in my app. I want the user to be able to click on an image in a page, and a popup menu appears. The user would have a selction of 5 items, and they would be able to click on one of them and the app would go to the selected menut item/page.
I have a popup Menu that works, but I am not able to style it. I have asked about it, but the answers seem to be that it is not possible to do so.
I have also implemented a PopupWindow, but although the items appear as a list, it is not possible to select them.
Would someone advice me as to what is the best to implement?
Thanks very much. I can post both sets of code: for PopupMenu and PopupWindow, if that helps.

Two-state button: Show current state or next state?

I have an action bar with a button to flip between two different views (list and tree). Should the button show (a) the current view or (b) the view that will be shown if the user clicks the button?
This is an age-old UI problem with no "right answer", only UI standards, so I'm trying to understand if there's any standard on this in Android.
I agree on the 'age-old' part. Myself I'm still questioning - when acting as a user, not a developer ;-) - what the button in front of me will do when I click it: turn on Shuffle or turn it of.
Now very pleased to come up with a feasible answer.
Since the user has a clear visual clue on the state the current presentation is in (List or Tree) the button would show the alternate option. Then the user knows that there is an alternate option and hopefully the button displays where it will take the user.
For more unclear situations I would still go with this approach. The user either knows or perhaps can deduce the current 'state' of the app ("hey it plays a whole different song now, so it is in shuffle"). So the button will bring me to another state, the one displayed.
Why display what the app is already doing and not displaying where a buttonpress will take the user?

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" ;-)

how to display an option menu when an activity starts

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.

Categories

Resources