I do this:
ADD TO XML: android:id="@string/myACTV"
NOW CODE:
AutoCompleteTextView myTextView =
(AutoCompleteTextView)findViewById(R.id.myACTV);
myTextView.setOnItemClickListener(
new OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent,
View view, int
position, long id)
{
//your code here!
}
});
On 18 Mar, 00:57, SurtaX <[email protected]> wrote:
> I've implemented a search suggestion which works fine.
>
> I've used the onSearchRequested() method to make it work as well as
> the following XML:
>
> <searchable xmlns:android="http://schemas.android.com/apk/res/
> android"
> android:label="@string/search_label"
> android:hint="@string/search_hint"
> android:includeInGlobalSearch="true"
> android:searchSuggestAuthority="authority"
> android:searchMode="queryRewriteFromData"
> android:searchSuggestIntentAction="android.intent.action.SEARCH">
> </searchable>
>
> However I cannot seem to dictate the behavior of the onClick function.
> When a suggestion is clicked, it fires off the intent immediately. Is
> there a way for it to instead of firing off the intent immediately,
> simply copy and paste the suggestion as part of the search string?
>
> Eg. when typing in J,o,h the suggestion "John" comes up. When I click
> "John" can it copy that text into the search bar instead of
> immediately processing the search with John?
>
> I'm assuming theres a simple configuration which I cant seem to find.
> I dont want to go extensively into catching the fired of intent and re-
> processing etc
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
To unsubscribe from this group, send email to
android-developers+unsubscribegooglegroups.com or reply to this email with the
words "REMOVE ME" as the subject.