android-search

how do I highlight the searched text in my search filter?

有些话、适合烂在心里 提交于 2019-11-29 01:57:52
I am trying to do a search such that all the "visible" search letters should be highlighted. I tried using spannable but that didn't do the trick, maybe I wasnt doing it right? based on this: Highlight searched text in ListView items How do i get to highlight the visible text? here's my filter : private LayoutInflater mInflater; private ValueFilter valueFilter; public MySimpleArrayAdapter(Activity context) { this.context = context; mInflater = LayoutInflater.from(context); } private class ValueFilter extends Filter { //Invoked in a worker thread to filter the data according to the constraint.

Android assisted Search: The search button does not invoke the searchable Activity (Other Solutions did not help)

隐身守侯 提交于 2019-11-28 11:24:44
I wrote this small test application to demonstrate the problem, that is the searchable activity is not started when the user presses the search button on the keyboard. I have been following the developer guides , but from my web search, it turns out that the official developer guide misses some points. From my SO search (which did not help): Reference 1: Solved by Adding tag in the element in the manifest. I also looked into the manifest of the sample "User Dictionary" (I don't know where can I find the samples online, or I would link to it). This tag is there in the application element.

Global search not working as expected in Android 4.4

我怕爱的太早我们不能终老 提交于 2019-11-28 07:25:51
I've got an application that has two search suggestion providers that both extend SearchRecentSuggestionsProvider , and I've set it up correctly in the manifest file with the following Intent filter and meta-data: <intent-filter> <action android:name="android.intent.action.SEARCH" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable_tv" /> The searcable resource includes android:includeInGlobalSearch="true" , so that should be fine. And I've obviously got a provider there as well: <provider android:name="com.miz.contentprovider

Action bar - ifRoom option leaving too much space

丶灬走出姿态 提交于 2019-11-28 07:00:24
问题 I have a problem on my Action bar, I tried to setup a search view on it in order to get a a search bar expandable. This is woking well except the fact that I had to set all the other menu items with the option ifRoom in order to let the search field take all the room when the search icon is clicked. This part also worked well except the fact that too many menu items got pushed into the menu overflow, only 2 icons remained on the vertical screen (including the search bar). I did another test

How to show Android Google default search results in webview?

跟風遠走 提交于 2019-11-27 19:02:12
问题 I want to display default Google search Results in webview of my Android application. We can do it using Google Custom Search API but it is paid. I want to use Google default search engine to replace the API. Could you please help me to provide its implementation. Thanks in Advance 回答1: If I get your question correct, you want to enable the user to enter a search term and then get google results in the webview . If you carefully notice, then in your browser if you enter following URL: https:/

How to remove white underline in a SearchView widget in Toolbar Android

拥有回忆 提交于 2019-11-27 18:57:20
I am using Toolbar search widget in my project. Everything works fine but expect the thing which I am completely stuck up with removing the underline below search field in my toolbar. I have tried many solutions and nothing works out. Below are the some of the solutions what i tried. Requirement is to remove white underline in the image Ist Solution: //Removing underline int searchPlateId = searchView.getContext().getResources().getIdentifier("android:id/search_plate", null, null); View searchPlate = searchView.findViewById(searchPlateId); if (searchPlate!=null) { searchPlate

SearchView in one activity, results in another one

丶灬走出姿态 提交于 2019-11-27 18:26:09
问题 My use case is the following: in activity A, I have an action bar with a collapsible SearchView. When the user gives her query and presses the 'search' button, I would like to show activity B with the results. I'm failing to do so, here is my code: searchable.xml: <?xml version="1.0" encoding="utf-8"?> <searchable xmlns:android="http://schemas.android.com/apk/res/android" android:hint="@string/action_search_hint" android:label="@string/app_name"/> Activity A: @Override public boolean

SearchView in expanded mode doesn't hide all action bar icons starting from Marshmallow

♀尐吖头ヾ 提交于 2019-11-27 16:29:40
SearchView looks fine on Lollipop devices (Android 21): But on Android 23-28 it doesn't hide all icons on the right side: <item android:id="@+id/action_search" android:title="@string/search" app:actionViewClass="androidx.appcompat.widget.SearchView" app:showAsAction="ifRoom"/> <item android:id="@+id/action_sort" android:title="@string/sorting" android:icon="@drawable/sort" app:showAsAction="ifRoom"/> How can I fix it? Update Seems Android 23 and higher don't hide icons anymore on the right (because there is enough space) But it only works fine if you don't have home button or hamburger menu on

How to remove android searchview popup text while searching?

柔情痞子 提交于 2019-11-27 14:44:53
问题 I have implemented action bar SearchView , it's working fine but at the bottom of the screen a floating text popup is shown. See screenshot: ListView Java class: @Override public boolean onQueryTextChange(String newText) { if (TextUtils.isEmpty(newText)) { mListView.clearTextFilter(); } else { // EventAdapterView ca = (EventAdapterView)mListView.getAdapter(); // ca.getFilter().filter(newText.toString()); // Filter lFilter = mDataAdapter.getFilter(); // lFilter.filter(""); // following line

Global search not working as expected in Android 4.4

北战南征 提交于 2019-11-27 01:49:07
问题 I've got an application that has two search suggestion providers that both extend SearchRecentSuggestionsProvider , and I've set it up correctly in the manifest file with the following Intent filter and meta-data: <intent-filter> <action android:name="android.intent.action.SEARCH" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="@xml/searchable_tv" /> The searcable resource includes android:includeInGlobalSearch="true" , so that should be fine. And I've