Suggest
The main function of the search suggestion is to display a result similar to the keyword based on the input keyword.
Mainly use the POISuggest class. The sample code is as follows:
POISuggest mPOISuggest=new POISuggest(); // Set the request parameters, mPOISuggest.setQuery(POISuggest.Query.newQuery("Food", "Beijing")); // Set the request to return the result listener interface mPOISuggest.setListener(new POISuggest.Listener() { @Override public void onSuccess(POISuggestResult result) { //Thread is an asynchronous thread, Android project needs to be in the UI thread, control control //The result returns successfully } @Override public void onFail(final APIStatus status) { //Result failed } }); // Start search suggestions mPOISuggest.search();
POISuggest.Query Description:
1. You can only get an instance via the newQuery(String keyword, String city) method in POISuggest.Query;
2. Parameter keyword: search keyword;
3. Parameter city: the city to search for, can be the name of the city, such as Beijing;
Note: The result return interface is an asynchronous thread interface. If the Android project needs to operate the control in the return, it must switch to the Main main thread.