Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SearchView widget - any way to SELECT ALL text inside?

I'm using SearchView widget (new in Honeycomb). I can set initial text by setQuery, that works.

But is there some way to select all text inside (similar to EditText.selectAll)?

I'd like to give user preset text from previous search, yet easy way to type new text without need to delete old.

like image 538
Pointer Null Avatar asked Oct 05 '11 15:10

Pointer Null


1 Answers

You just need to capture the inner EditText, then do anything you want.

EditText edit = (EditText)searchView.findViewById(R.id.search_src_text);
edit.selectAll();
like image 172
Comp Avatar answered Oct 12 '22 11:10

Comp