如何在Android中的3个字符后启动自动完成Google地图位置搜索

问题描述

在我的代码中,我限制了“自动完成GoogleMap位置”搜索的字符。因此,键入3个字符后,只有地图才开始搜索位置。

我使用了 setthreshold(3)方法来实现它,并减少了GoogleMap API的点击率。但是在更新以下插件之后

实施'com.google.android.libraries.places:places:2.3.0'

在当前的位置搜索场景中,我错过了此功能

通过这种方式,我现在称为GoogleMap的Locationsearch活动,

List<Place.Field> fields = Arrays.asList(Place.Field.ID,Place.Field.NAME,Place.Field.ADDRESS,Place.Field.LAT_LNG);
        // Start the autocomplete intent.
        Intent intent = new Autocomplete.IntentBuilder(AutocompleteActivityMode.FULLSCREEN,fields).setCountry("IND") //NIGERIA
                .build(this);
        startActivityForResult(intent,AUTOCOMPLETE_REQUEST_CODE);

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)