Am new to android, and i have seen some videos regarding the training,
In that, i have seen like if you want to type the below code
Button B1;
In that video, that person will type "But" and it will automatically list Button class.
I don't know how to do this in my eclipse ?
After typing letter, you need to press ctrl+spacebar.. It will show you list of classes starting with that letter and you can choose one of them as per your requirement.
Related
I want to display hashtags in the android Edit-text when user types the keyword, and then hits "Space" then Edit-text takes that keyword automatically. here i have attached one screen shot. i need that kind of functionality.User can also remove the hashtag individually and all the hashtags by clicking cancel button.
Need functionality exactly same like when we entering the tags in the stackoverflow when asking a question.
Check this library - it provides basically the same functionality as you requested.
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.
How do I add a "edittext" that when you type in a specific word such as "apple" it will make a new xml page pop up. But if the user types in a different word besides "apple" it will make a different xml page pop up.
What I'm trying to accomplish is somethings similar to a logo quiz game where when you type in the right word, a new thing pops up.
I have absolutely no idea how to do it. if u could show me a video on how to do it, that would be very helpful thanks! :)
You should use a TextWatcher to watch for changes and do whatever you want on afterTextChanged().
I want to design a button such that when it is clicked, I get various options, from which I finally select one.
This is the same as using the concept as in text messages. For example: If we press and hold a, then we get various options for the various accents of 'a' in small buttons just above/below the button clicked.
How do I implement this in Android? Do I have to use context menus? How do I get the various options in small buttons? For that, will I have to use an OnTouchlistener?
Take a look at KeybordView.java from the 2.2_r1.1 release. That is the class that implements the keyboard handling. Pay special attention to the Handler around line 246 and the openPopupIfRequired method that displays the popup for the key if there is a long press.
Good luck.
I am trying to create my own Phone Dialer from scratch in Eclipse Android, I did a simple phone layout in the XML with numbers 0-9 and some Buttons/ImageButtons.
Basically I put some Buttons and ImageButtons and I understand that I need call setOnClickListener() on them in the Java code. Something like:
Button no1 = (Button) findViewById(R.id.button1);
no1.setOnClickListener(new View.OnClickListener()
I did an <EditText on top of the numbers (Buttons and ImageButtons) to display the numbers. But nothing come out when I click. I am not sure what I miss out which cause this problem.
I also did a "settings" button in the same XML file, which upon clicking on the button, a toast will pop out which have a couple of clickable icons. I am not too sure on how to do it. I did read some tutorials but mine seems to be not quite right.
hopefully if the above-mentioned points can be rectified, I hope I can try to make the SMS characters to be Unicode, which can limit to lets say 50 characters etc.. but that's still far-fetched for me though. I'll do this in the later part.
I did a Google research but I don't quite get the correct info as its just bits and pieces here and there...
Actually I want to create this customized phone dialer as I intent to install it in my Mum's 2.1 Froyo phone.
Can anyone advise me please? Is there a sample code where I can check what I went wrong?
Have your class implement OnClickListener and make a switch(arg0.getId()) and a case for each number pressed.
Every time you press a number have an EditText receive that number and then when you press the call button have it call the numbers in that EditText.
In that amount of time, the application may still have some flaws in it. But you are on the right track. I would have your class xxx.java extend View.OnClickListener, then you can add your class as the listener for each button, e.g. no1.setOnClickListener(this);. Use a switch statement to figure out the phone number and make the call.