diff options
| author | Dmitri Plotnikov <dplotnikov@google.com> | 2010-10-21 21:16:42 -0700 |
|---|---|---|
| committer | Dmitri Plotnikov <dplotnikov@google.com> | 2010-10-21 21:16:42 -0700 |
| commit | 87c5025fb8a21348ead7cd7e6fa08aa5dc0f501e (patch) | |
| tree | ec397ac87c4145d658173f5e3166006da4f0a9b6 /core | |
| parent | beb2178b49e29550a4d2957cff2b602ed8517c6b (diff) | |
| download | frameworks_base-87c5025fb8a21348ead7cd7e6fa08aa5dc0f501e.zip frameworks_base-87c5025fb8a21348ead7cd7e6fa08aa5dc0f501e.tar.gz frameworks_base-87c5025fb8a21348ead7cd7e6fa08aa5dc0f501e.tar.bz2 | |
Moving cursor to the end of the search query when set explicitly.
This situation is encountered in Contacts when the activity
intercepts unsolicited input from the keyboard, takes that
character entered by the user and switches the whole app
to "search mode". At this time it puts the character
entered by the user in the search field. The user should be
able to continue typing.
Change-Id: Ief40f12bb8f31bced6114d61a0fd95472f21b1be
Diffstat (limited to 'core')
| -rw-r--r-- | core/java/android/widget/SearchView.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/java/android/widget/SearchView.java b/core/java/android/widget/SearchView.java index 1d36b49..029aebf 100644 --- a/core/java/android/widget/SearchView.java +++ b/core/java/android/widget/SearchView.java @@ -306,6 +306,10 @@ public class SearchView extends LinearLayout { */ public void setQuery(CharSequence query, boolean submit) { mQueryTextView.setText(query); + if (query != null) { + mQueryTextView.setSelection(query.length()); + } + // If the query is not empty and submit is requested, submit the query if (submit && !TextUtils.isEmpty(query)) { onSubmitQuery(); |
