android-searchmanager

Does ActionBarSherlock 4.2 support search suggestions for a SearchView?

核能气质少年 提交于 2020-01-12 05:49:11
问题 A month ago, I dropped-in ActionBarSherlock 4.2 into my project. I got everything to work, except the search suggestions for my SearchView . The way I was creating search suggestions was using the method in the Android documentation. Does ActionBarSherlock support search suggestions? I tried to dig through the issue list on the Github page but the issue seems closed but I can't seem to follow the discussion and understand whether it really is a resolved or not. I thought that some of you who

Keep different search histories for different activities?

帅比萌擦擦* 提交于 2020-01-01 05:36:14
问题 I have two activities, and I'd like them to each maintain their own search history suggestions. Is that possible? They each have their own search suggestion provider, but I see the same search history appearing for both activities: // manifest.xml <activity android:name="ActivityA" ... <meta-data android:name="android.app.searchable" android:resource="@xml/searchable_A" /> </activity> <activity android:name="ActivityB" ... <meta-data android:name="android.app.searchable" android:resource="

Show SearchWidget in ActionBar if user presses the device's search button

放肆的年华 提交于 2019-12-30 06:20:08
问题 I set up a SearchWidget as described in the Android API Guide. It properly displays a magnifying glass icon in the Action Bar and if I click on it, it launches the search widget within the Action Bar (an input field with dark background). However, if I press the virtual device's search button, then a different search field is launched: It has a white background and does not invoke the callback methods I specified. So I added this to my MainActivity class: public boolean onSearchRequested() {

Android Search not returning results after suggestion chosen

我们两清 提交于 2019-12-25 15:57:21
问题 I have a simple application that just uses the hardware search key to search my database via my content provider. After getting the results from the Suggestions and clicking on one of the choices the listview screen appears and it's blank. I get an error: E/InputQueue-JNI(1137): channel '4150a5d0 PopupWindow:412ccf98 (client)' ~ Publisher closed input channel or an error occurred. events=0x8 I'm new to android development, I did some research, but can't figure out what this even means. Here's

Search Box on Home Screen

自作多情 提交于 2019-12-25 04:49:05
问题 I have used SearchManager and it provides search key only when app is launched. Is there a way to put a text box on the home screen/wallpaper and invoke activity when user presses enter? 回答1: You can use widgets on the home screen, which you can have contain a textView and you can use an intent to launch an acticity you want on the press of enter - or any other event. 来源: https://stackoverflow.com/questions/3375615/search-box-on-home-screen

Problem passing a Bundle with onSearchRequested

穿精又带淫゛_ 提交于 2019-12-24 02:45:11
问题 I'm actually trying to use the built-in search interface of Android, but I have some issues when I try to pass data with the search query. Here is a brief explanation : I have an object in a first Activity (FirstActivity) called "Category" which implements Serializable (I already pass it successfuly between Activities) and I want to perform a search related to that category, and display the results in a second Activity (SecondActivity). So, in FirstActivity I override the onSearchRequest

Call to method onSearchRequested() in the same activity that handles search requests causes duplication in activity stack

不打扰是莪最后的温柔 提交于 2019-12-23 17:17:15
问题 I have an activity that handles search requests with the SearchManager and it's working just fine. Let's call this activity MySearchActivity.java. The problem is that within this activity, I have a button that invokes the search request dialog with a call to onSearchRequested(). If MySearchActivity.java is the current task in the activity stack and the user taps the icon within this activity that calls onSearchRequested(), this activity is re-launched on top of itself. So within the activity

Search View Icon Position Change

旧街凉风 提交于 2019-12-23 12:37:35
问题 I have implemented a SearchView in a toolbar as shown in image below. Here, the search icon is on the right side of a cursor . And it gets invisible with the hint. I want to shift the search icon on the left side of a cursor and also it should not get invisible with the hint. it should be in this order.. [ SearchIcon-Cursor-Hint ] I want it like this image.. Can anyone please help me out... :( 回答1: if you are using an edittext control, you can do it in the edittext as follows... android

Using SearchManager's SUGGEST_COLUMN_ICON_1 to display a local file

独自空忆成欢 提交于 2019-12-23 06:04:38
问题 I'm implementing my own SearchRecentSuggestionsProvider and everything's working except one thing: I can't get the device search to display icons for the results. I'd like to display images from my application's data folder (located at /{sdcard}/Android/data/package_name/files/ ) According to the documentation, it's achievable by using SearchManager.SUGGEST_COLUMN_ICON_1 , and it apparently supports a number of schemes, including ContentResolver.SCHEME_FILE , which is file . Here's a quote

A simple image search app

时光怂恿深爱的人放手 提交于 2019-12-23 02:16:04
问题 I want to develop a simple application, that will Searches images with keyword Browses the images Saves the images if i can do it with Google, it would be better. so far i found this after Googling: try { Intent intent = new Intent(Intent.ACTION_WEB_SEARCH); String term = editText.getText().toString(); intent.putExtra(SearchManager.QUERY, term); startActivity(intent); } catch (Exception ex) { } and intent = new Intent(Intent.ACTION_VIEW, Uri.parse( "http://images.google.com/search? num=10&hl