I would like to create a listview that looks like 'Settings' in Android (i.e. If I click "Sound & Display" item, it will show items such as "silent mode, ringer volume, etc"). It looks like PreferenceScreen but this time, it doesn't configure anything.
A clearer example:
What I wanted was when an item category is selected -- let's say, Hospitals --, it calls another listview which contains a roster of hospitals around the area. When one of the items in the roster is selected, it will execute the call intent and dial the number. And if I wanted to go back to the list, I will just press the back button then see other categories.
Thanks in advance!
Try this,
Android Preferences
And Also
Android - creating a custom preferences activity screen
Related
I am using Basic4Android as my programming language and I am trying to display the popup menu using the AHQuickAction library. (v1.01)
I am trying to make it when you tap on a label make it display the popup menu.
I am using the following code (which displays the popup menu)
Sub lblTest_Click
Dim lbl As Label
lbl = Sender
ac1.show(Sender)
End Sub
however, it always displays the popup under the item I taped on.
As shown in the image below I taped on the last item in the list (Test 19) and the popup is displaying on top of the item I taped on and looks like I taped on Test 17.
is there a way to display the correct item I taped on ?
I have attached the code as a zip so you can see what I mean and you might be able to tell me what I am missing. - My Example Code
In the example code, run the app on your device and tap on the label on the left in the app. You will find that it always displays under the item you tap on, where if there is space above the item you tapped on it never displays there.
Hope someone can help me out.
How do you use addContextMenuItem in sl4a?
I'm using the experimental full-screen UI to display a list view. I want to:
1) trap a long-press on an item on the list
2) show a "pop-up" menu of options relating to that item.
The listview part works fine.
I know how I can do 2) once I get an event (simply display an alert and add items) but I can't see what user action actually triggers the event you define, or how to control it.
E.g. what will fire the "Play" event defined below, and how do I control what does?
droid.addContextMenuItem("Play", "contextmenu", "test")
I have a button that says "Sort" and when a user normal/short presses the button, I want a menu to appear with the various sort options. Looking around online there doesn't seem to be a straight forward answer to which route is considered best practice. I'm looking to have a menu that looks similar to this:
with icons and text.
For an example, click the Layers button in the Google Maps app. It opens a list of options on a single short click. It has a title at the top and icons for each option. (The icons aren't super crucial)
Should I use a Context Menu? If so, how do I do it without a long press. Should it be a Spinner? If so how do I change the appearance to use a button instead of the normal drop down box.
Spinners are for stateful selection, which sounds like what you want here. The user will select one sort option from a list, and there is a concept of a "current" sort that stays visible to the user.
For something like the activity picker in your screenshot, Falmarri's suggestion of an AlertDialog is reasonable. The difference between choosing a sort and the activity picker is the "stateful selection" distinction. Spinners have a concept of a currently selected item already provided for you, dialogs are more general.
http://developer.android.com/reference/android/app/AlertDialog.html
i have a list.When i click on any item in the list a popup should appear where i can send messages(something like what happens when we click a user in gmail.A popup window comes up in the bottom and we can chat with that user).
I guess you want to add a Quick Action to your application.
You should be able to get your answer from this question.
Is it possible to have something similar like Blackberry in Android:
link text
I want to add a menu item particularly to the Contacts Option menu.
please let me know if this can be done in android.
Can you specify more clearly what you're trying to achieve / where you want to add the menu.
The menu that appears when you press the menu button on BB is equivalent to the menu options that come up when you press the menu button on Android.
Talking about the Contact application on Android, this would be the menu with the menu items "Search, Display options, Get Friends, My Profile, ..." in the Contact app's list view.
Take a look at http://developer.android.com/reference/android/view/Menu.html