I'm working on an android app , we need a custom dialog box to input some settings once in a while . This custom dialog box need to be hard to find so only some users can find it , like a onLongClick somewhere .
Any Ideas ?
Just think out of the box, what android users are not familiar of something that is not user friendly, the LongClick action every android users do long clicks so do something like a swipe up or down on a button or image be creative :)
Related
I am a new developer and I want to build an app for a personal purpose.
I would like to receive some input when the application load up on with dialog box with textbox for input only number and 1 button "Ok".
I tried to find solutions but could not so.
Thank you for all !
Android do built in alert dialog. What you need just inflate your custom layout to create alert dialog. You don't have to add your custom button which android also provite negative(some cancel action),positive(some comfirm action),neutral(which is something work like default) button for you. Which you just need to study the link.
In my application I currently have an xml layout that is re-used to enter information 6 times (these are turns in a game). This works fine. At the end of the round I present a screen that has a summary of each turn. I want to implement a button beside each turn to "edit" that turn. There are 3 possible things that can be edited. Ideally an alert dialog or something like a "popup" would be idea for this.
Would I be best off to have 3 buttons per "turn" for editing or is there a way to do this with a popup?
Thanks for your input on this matter.
You could list each turn and it's information with a single edit button next to each. When the edit button is pressed, create a new activity (intent) that prompts for all three pieces of data.
You have several options (and probably more I'm not thinking about). If these are in a ListView (or even if not) you could use a ContextMenu. You could have options in here to change the selected item or others. This would show a popup when the user long clicks the item
A PopupMenu can give you a similar effect that can pop up a list of options when the user clicks on a Button. Note that this requires API >= 11
You also could use an AlertDialog, as you mentioned. But just from what little I know about what you are trying to do I'm not sure this is what you would want.
Again, I don't know enough details about what you have or want but I would say that one of the first two options would suit you best. As far as one Button or multiple Buttons, that depends on the layout that will work best for your app, I suppose. You certainly could have one "Edit" Button which uses something like a PopupMenu and allows the user to choose what to edit. I hope this helped a little.
I am developing a chat application. And i want to have pop up window with smileys in it so that when user clicks on one of smileys it will be inserted to edit text box.
Does anyone know sample code for it?
I wanted code for both pop up window and code to embbed smileys in an application.
(same as in case of yahoo which has smileys.how to code for it and how to store them in database and all)
Take a look at the PopupWindow. You'll want to use it in similar fashion to this tutorial here: http://www.mobilemancer.com/2011/01/08/popup-window-in-android/.
I would populate it with your drawable images, and then attach to each image you create a onClickListener that would insert the smiley into whatever text window your using.
I'm not an Android expert, and I'm still learning myself, but this is one approach I would investigate.
In Google Maps, when you click the search box the real search comes up. The search box is just an imageview illusion with an onclicklistener
similarly, if you press the search button on the mobile device, the search box comes up.
I need to implement similar behavior, when the user clicks an image that is over the map (in a relativelayout), the search box for that mapview comes up.
how would I call the mapview's search feature??? I was thinking of just simulating a search button press but I dont even know what this function's name is.
Thanks for the insight!
The function you are looking for is onSearchRequested(). Just make a call on your onClickListener. Complete guide to search implementation can be found here.
http://developer.android.com/guide/topics/search/index.html
Pretty new to android so excuse me if this is a really obvious question.
Say my application has a bunch of TextViews, each one showing the attributes of a certain product (name, price, etc). I have a button next to each of these TextViews labeled "modify".
How do I make it so that when I press the modify button next to a certain attribute, a popup window with a space to enter text into comes up so that the user can enter text into this box and then have the actual attribute listing on the original page change? Actually I just need a push in the right direction with creating this popup text field... not sure if there is already some built in functionality for this or if not, what would be the best way to create this kind of thing.
Thanks.
Why not have the modify button set TextEdit.setEnabled(true); and then change focus with TextEdit.setFocus? Note that both of these are inherited from view
If you really want a dialog you might want to looking into the AlertDialog.Builder. I know you can use it with buttons and radio buttons, but I'm not sure you can get it to work with a TextView.
Use a code like this for the input popup: Android dialog input text
In the positive button handler, set your edittext content programmatically like this:
myEditText.setText(value).
As simple as that. The only difference with a standard GUI framework is that you don't retrieve the value as a result of the popup function. Instead, you must provide an action handler.