Location:

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. The parameter keyword is the keyword for the search.

3. The parameter city is the city to search for, and it can be the city name/adcode such as Beijing.

Note: The result return interface is an asynchronous thread interface.

TOP