android-searchmanager

When is it necessary to use singleTop launchMode in an android widget or application?

自闭症网瘾萝莉.ら 提交于 2019-11-28 07:23:11
I just got burned by a widget. I could see the cause of the problem, but I could not determine why or its solution. My widget was issuing a search (SearchManager) and the activity launched a search dialog, but when it called-back to my widget, it created another reference to the widget (i.e., the thread-id was the same, but the widget-id changed from 65 to 0). This led me to believe that a new instance was getting created and I searched the documentation for settings that would apply to the problem. Eventually, I stumbled upon the android:launchMode="singleTop" and as soon as I set it in the

Multiple Choice Searchable ListView

我是研究僧i 提交于 2019-11-28 02:57:19
问题 OK I have a multiple choice ListView that works fine. I check the boxes for the contacts (held in a String[]) and can return the values fine. Because some people have a bunch of contacts I wanted to create a search bar kind of like the stock one for the Android phone book. I created an EditText and aligned it above my list. I found the filtering code here on StackOverflow and it works wonderfully. My Problem: When you filter someones name out, and you select the name, when you either

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 getActionView returning null

痞子三分冷 提交于 2019-11-27 12:34:02
This was working a few days ago, but suddenly it stopped. I only want to use the action bar search widget when certain fragment is visible. Now I'm unable to get the SearchView , now getActionView always returns null. searchable.xml <?xml version="1.0" encoding="utf-8"?> <searchable xmlns:android="http://schemas.android.com/apk/res/android" android:label="@string/app_name" android:hint="@string/search_for_places"> </searchable> Manifest.xml <activity android:name=".ui.activities.MainActivity" android:launchMode="singleTop"> <intent-filter> <action android:name="android.intent.action.MAIN"/>

Search widget on action bar doesn't trigger my search activity

假如想象 提交于 2019-11-27 11:48:43
问题 I'm developing search widget interface based on official tutorial: http://developer.android.com/guide/topics/search/search-dialog.html Problem: My SearchableActivity doesn't get triggered when I enter my query and press Ok/enter. Manifest for SearchableActivity: <activity android:name="SearchableActivity" android:launchMode="singleTop" > <intent-filter> <action android:name="android.intent.action.SEARCH" /> </intent-filter> <meta-data android:name="android.app.searchable" android:resource="

When is it necessary to use singleTop launchMode in an android widget or application?

对着背影说爱祢 提交于 2019-11-27 01:47:51
问题 I just got burned by a widget. I could see the cause of the problem, but I could not determine why or its solution. My widget was issuing a search (SearchManager) and the activity launched a search dialog, but when it called-back to my widget, it created another reference to the widget (i.e., the thread-id was the same, but the widget-id changed from 65 to 0). This led me to believe that a new instance was getting created and I searched the documentation for settings that would apply to the

SearchView getActionView returning null

倖福魔咒の 提交于 2019-11-26 18:12:22
问题 This was working a few days ago, but suddenly it stopped. I only want to use the action bar search widget when certain fragment is visible. Now I'm unable to get the SearchView , now getActionView always returns null. searchable.xml <?xml version="1.0" encoding="utf-8"?> <searchable xmlns:android="http://schemas.android.com/apk/res/android" android:label="@string/app_name" android:hint="@string/search_for_places"> </searchable> Manifest.xml <activity android:name=".ui.activities.MainActivity"

Applying Word Stemming in SearchView for fetch data from Firebase database

流过昼夜 提交于 2019-11-26 18:02:00
I need to fetch list of users from Firebase database using SeachView or search dialog and I think word stemming will be best for my app. Not asking for code but please tell me the alorigthm for it. To achieve what you want, you need to execute a query which should look like this: DatabaseReference rootRef = FirebaseDatabase.getInstance().getReference(); DatabaseReference usersRef = rootRef.child("users"); Query query = usersRef.orderByChild("name").equalTo(newText); So everytime you create a search you should return a new query. So according to this, every time you want to filter on a new

Android search with Fragments

假装没事ソ 提交于 2019-11-26 04:30:01
问题 Does somebody know of a tutorial or an example of how to implement the standard Android search interface with Fragment s? In other words, is it possible to put a standard search with a SearchManager in a Fragment? 回答1: In short, you can't. There are a couple of reasons why creating a search interface within a Fragment is not possible. When creating a searchable interface, you must specify a default "searchable activity" in your Android manifest. As I'm sure you know, a Fragment cannot exist