我想从Google Place Picker API隐藏搜索栏

时间:2019-06-15 07:37:48

标签: android

Click to this to view Image我正在使用Google Place Picker Api,现在我想从Place Picker隐藏上方的搜索栏。有什么办法。

我在互联网上进行了大量搜索,但找不到任何解决方案。

btn_map.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            try {

                PlacePicker.IntentBuilder intentBuilder = new PlacePicker.IntentBuilder();
                intentBuilder.setLatLngBounds(BOUNDS_MOUNTAIN_VIEW);
                Intent intent = intentBuilder.build(MainActivity.this);
                startActivityForResult(intent, 1);

            } catch (Exception e) {
                e.getMessage();
            }
        }
    });

@Override
protected void onActivityResult(int requestCode, int resultCode, @Nullable Intent data) {
    if (requestCode == PLACE_PICKER_REQUEST
            && resultCode == Activity.RESULT_OK) {

        final Place place = PlacePicker.getPlace(this, data);
        final CharSequence name = place.getName();
        final CharSequence address = place.getAddress();
        String attributions = (String) place.getAttributions();
        if (attributions == null) {
            attributions = "";
        }

    } else {
        super.onActivityResult(requestCode,resultCode, data);
    }
}

0 个答案:

没有答案