I see that after android 3.0 it introduce into the isselectable attribute, but i found even in android 2.1, the SMS editbox can allow user double click a word you typed and highlight to select it. how does it work? i thought it's a regular edittext box but it's not. the layout edittext box can't doubleclick and select a single word, it can just press and drag to select, and it works very bad.
so, does anyone know how to implement this: when i double click(or long click) a word of the text in TextView(or any other view), the word can be selected and i can perform some actions.
who knows how the SMS editing box implement?
thanks.
I did answer a (somehow) similar question here. The solutions should work from Android 1.5
But this works with the "mark some text"-solution. Maybe it's helpful anyways.
Related
While typing a text some word are automatically autocorrected when space is pressed. If that happens I want to mark this word.
My problem is I can't find a way to find out when a word is autocorrected.
So my question is how do you find out when a word is automatically autocorrected?
Edit:
I have a TextView and I want to know if there is a possibility to find out if a word was autocorrected while typing a text.
Or is that impossible from inside of the application and only the keyboard can tell if a word was autocorreted? So basically I would need to implement a custom keyboard to know when a word is autokorrected?
Even a Snippet of an android code to Integrate Google Search into an Edit text will be really useful, according to my requirement i don't want the google search data or whatever but only the dropdown so that it will b easier for people to type and don't have to waste time :)
You can see about the componenent is AutoCompleteTextView
An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.
I just downloaded AOSP and modified TextView for my purpose.
I have added a LongClick Listener to the TextView, which shows a simple Toast.
Since I modified the Android framework, it is reflected into all the apps and entire Android OS.
I have now run into a weird issue where the TextView is getting focus in some places and other underlying widgets are not getting any focus. This is creating lot of issues.
For eg: In Settings app, The 'Wi-Fi' text is receiving focus, but I cannot enter the wi-fi settings unless I click in any empty area in the Wi-Fi list item.
(I hope am clear!)
Another example: I am unable to select the Radio Button just because the text corresponding to Radio Button receives focus.
So my question is:
Is there any way I can make TextView non-focusable but receive Long Click events?
Is there any way I can pass the focus down to the parent layout?
Any other way you can suggest?
(PS: Please do not say what I am doing is right or wrong. It's just a feasibility test for what I am trying to achieve.)
A view does have the attributes "focusable" and "longClickable". Have you tried a combination of these?
I have a MultiAutoCompleteTextView implemented on one of my screens. I was testing the application in various smartphones and when I tested in a smartphone that had XT9 turned on the texbox works, however when the word was selected in my textbox the XT9 does not clean the letters already typed, then when I started to type again the previous letters from the first word show up.
So I need to turn of XT9 in this screen or clean XT9 letters list. Someone knows how to do it?
Thanks
I found that to disable the autocomplete of the Input I just needed to add the attribute android:inputType="textAutoComplete" on the MultiAutocompleteTextView's xml
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.