나는 액션 바에 SearchView
을 가지고 있으며, 서비스에서 제안을 가져오고 싶습니다.네트워크에서 안드로이드 searchview 님의 제안
안드로이드에서 샘플을 보았습니다 Samples Searchable Dictionary
. 하지만 로컬 데이터베이스에서 결과를로드하고 있습니다.
알았어. Content Provider
을 사용해야합니다. 하지만 웹 서비스에서 결과를 가져올 때 궁금합니다. 네트워크 통화를 할 때를 의미합니다. 누구든지 도와 주실 수 있습니다. 당신은 프로젝트 및 이러한 방법이 작동하는 방법 문서에서 볼 수 있듯이 당신이 거기에 구현하는 두 가지 방법
/**
* Called when the user submits the query. This could be due to a key press on the
* keyboard or due to pressing a submit button.
* The listener can override the standard behavior by returning true
* to indicate that it has handled the submit request. Otherwise return false to
* let the SearchView handle the submission by launching any associated intent.
*
* @param query the query text that is to be submitted
*
* @return true if the query has been handled by the listener, false to let the
* SearchView perform the default action.
*/
boolean onQueryTextSubmit(String query);
/**
* Called when the query text is changed by the user.
*
* @param newText the new content of the query text field.
*
* @return false if the SearchView should perform the default action of showing any
* suggestions if available, true if the action was handled by the listener.
*/
boolean onQueryTextChange(String newText);
수있는 제안을 보여주고 싶은 당신이 searchview를 사용하는 그렇다면