Google Search Like Widget Example
I am looking for example for Google Search like home page widget from where user can type-in keywords to search within my app. Youtube video here.
I followed the tutorial at the dev guide. However, it lists the available RemoteViews, and there is no EditView开发者_StackOverflow社区. In such case how can I provide a editable text-box. I want to build a widget similar to SearchManager UI, but available as widget at home-screen.
EditText is not available on widgets. That's why there's no EditText on the search widget. It just looks like EditText. When you click over the search widget it starts another activity with EditText.
As above, EditText is not available for widgets. The video you pointed to is of a fake Android. That is not a real Android device and was made for that video only.
Search Widget is what you are looking for. There are two ways of implementing it, 1) Using a SearchView
(which behaves like, and is an extension of EditText
) and 2) using a Search Dialog. I believe, you'd need to use the 1st approach. The linked page has a nice helpful tutorial to get your started.
精彩评论