android-search

What's the difference between android.app.default_searchable and android.app.searchable meta-data?

亡梦爱人 提交于 2019-12-07 04:35:55
问题 I'm pretty new to Android and I need a search widget to get suggestions from my own dictionary. I realized some tutorials use android.app.default_searchable meta-data and others the android.app.searchable . I can't find the difference explained though. 回答1: The difference is that android.app.default_searchable is used to declare which searchable activity to use for searches, the activity has enabled the search dialog. While the user is in this activity and when the user executes the search,

Elements in Relative Layout showing differently when the app runs

笑着哭i 提交于 2019-12-06 12:06:26
I have a ListView created inside a fragment, and it has a search filter, the problem is XML layout showing fine in android studio but when running in the emulator or phone it's showing differently (not properly as I aligned) and also when I click the SearchView it goes under the tab navigation. Can anyone tell how to fix this? This is the fragment: import android.content.Context; import android.os.Bundle; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.ImageView;

Parse.com : How to Adding a search filter for a Parse ListView inside inside a Fragment

我的未来我决定 提交于 2019-12-06 10:53:16
问题 I'm trying to add a Search filter for a ListView which is inside a tab fragment . the data is called from parse server using and adapter . my fragment java file is below SportsCar.java import android.os.Bundle; import android.text.Editable; import android.text.TextWatcher; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.EditText; import com.parse.FindCallback; import

Android Search Interface not submitting query

北慕城南 提交于 2019-12-05 18:35:25
I've implemented a Search Interface (the Search Widget) by following the official tutorial for Search Interface closely. It all looks good but I can't submit the search query. When I click the "Send" button on the keyboard nothing happens. Here is what I did: AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="18" /> <uses-permission android:name="android.permission.GET_ACCOUNTS" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

How to Implement Floating SearchWidget Android

怎甘沉沦 提交于 2019-12-05 14:54:49
I am trying to implement the search widget in the current android apps, but just can't get it done and I've not been able to implement it. Below is my code MainActivity @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE); SearchView searchView = (SearchView) menu.findItem(R.id.search_bar).getActionView(); searchView.setSearchableInfo(searchManager.getSearchableInfo

What's the difference between android.app.default_searchable and android.app.searchable meta-data?

只愿长相守 提交于 2019-12-05 08:38:45
I'm pretty new to Android and I need a search widget to get suggestions from my own dictionary. I realized some tutorials use android.app.default_searchable meta-data and others the android.app.searchable . I can't find the difference explained though. The difference is that android.app.default_searchable is used to declare which searchable activity to use for searches, the activity has enabled the search dialog. While the user is in this activity and when the user executes the search, the system starts SearchableActivity and delivers it the ACTION_SEARCH intent. By instance if you want to

android.support.v4.widget.SearchViewCompat example?

六月ゝ 毕业季﹏ 提交于 2019-12-05 01:14:50
I am trying to use SearchViewCompat with ActionBarSherlock in an API 8 app. public boolean onCreateOptionsMenu(Menu menu) { MenuItem item = menu.add("Search") .setIcon(isLight ? R.drawable.ic_search_inverse : R.drawable.ic_search) .setActionView(R.layout.collapsible_edittext); item.setShowAsAction( MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW); // To use SearchViewCompat, I need to add it to the Menu item as well: View searchView = SearchViewCompat.newSearchView(this); // ... SearchViewCompat.setOnQueryTextListener(...); // ... item.setActionView(searchView);

How to detect SearchView's back button press?

北战南征 提交于 2019-12-04 23:22:53
I'm using a single activity to display SearchView as well as to display search results. The search results is just a subset of items so the search acts as a filter. Everything seems to work fine except that I can't figure out how to restore all items in the view when a back button of SearchView is clicked on. Or maybe there is another way to detect when a user navigates from search results to the previous view (which, in my case, is the same view). Thanks Darwind So looking at the title of your question, you're not sure how to detect when the SearchView is being closed and hence you're not

Custom SearchView whole clickable in android

[亡魂溺海] 提交于 2019-12-04 22:41:00
I have a SearchView widget in my app, and I want to ask some questions about making it custom. First of all, you can start search only by clicking on search icon, is there any way to make whole SearchView clickable? Also, is there a way to make SearchView appear something like this when it is clicked? It is now in this state: Here is my code: citySearch = (SearchView) findViewById(R.id.city_search_bar); citySearch.setBackgroundResource(R.drawable.search_background); citySearch.setOnSearchClickListener(new OnClickListener() { @Override public void onClick(View arg0) { citySearch

Is there any listener on Android SearchView to notify if SearchView is expanded and ready to take input?

社会主义新天地 提交于 2019-12-04 18:28:35
问题 I want to show some default suggestions in SearchView when User hasn't typed anything. I am setting my custom suggestion adapter manually using matrix cursor. I tried setting adapter in onFocusChange and onClickListner but suggestions get hidden behind a keyboard, apparently suggestions are loading earlier than keyboard. I did not find any listener which tells me that searchview is completely loaded with keyboard in the view. Help me in finding the right solution or any workaround. I have