[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-09-04 UTC"],[],[],null,["Select platform: [Android](/maps/documentation/places/android-sdk/basic-place-autocomplete-ui-kit \"View this page for the Android platform docs.\") [iOS](/maps/documentation/places/ios-sdk/basic-place-autocomplete-ui-kit \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/places-ui-kit/basic-autocomplete \"View this page for the JavaScript platform docs.\")\n\n\u003cbr /\u003e\n\nBasic Place Autocomplete component\n==================================\n\n\nThe Basic Place Autocomplete component of the Places UI Kit lets you add an individual UI component that returns a [place ID](/maps/documentation/places/android-sdk/place-id) when a user selects a place. The component is a full screen cover that provides a search bar for users to enter a query. As the user types, a list of autocomplete results will be shown below the search bar. When the user taps on a place, a place object with only place ID is returned to the developer. This component is customizable.\n\n\nThe Basic Place Autocomplete component has the following customization options: list density, and whether to include location icons. Use [`AutocompleteUICustomization`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/widget/model/AutocompleteUiCustomization) to customize the component.\n\n\nYou can use the Basic Place Autocomplete component independently or in conjunction with other Google Maps Platform APIs and services.\n\nBilling\n-------\n\n\nYou are billed each time the component is opened and a query is made. You won't be billed again for that session unless the session expires or a place is selected from the list.\n\nAdd the Basic Autocomplete component to your app\n------------------------------------------------\n\n\nSet the autocomplete filter parameters (for example, the types to return, the country to limit results to, the region coordinates for results, the origin of the request to display distance information, if available) as you would to use Place Autocomplete (New) without the Places UI Kit. See the [Place Autocomplete (New) documentation](/maps/documentation/places/android-sdk/place-autocomplete) for full instructions and [an example of the code to create an autocomplete filter](/maps/documentation/places/android-sdk/place-autocomplete#optional-parameters).\n\n\nOnce you've created your autocomplete filter, add your UI customizations. [See customization options and instructions.](/maps/documentation/places/android-sdk/basic-place-autocomplete#customize-the-basic-autocomplete-component) \n\n### Kotlin\n\n```kotlin\nAutocompleteUiCustomization.create(\n listDensity = AutocompleteListDensity.MULTI_LINE,\n listItemIcon = AutocompleteUiIcon.noIcon(),\n)\n```\n\n### Java\n\n```java\n \nAutocompleteUiCustomization.builder()\n .listItemIcon(AutocompleteUiIcon.noIcon())\n .listDensity(AutocompleteListDensity.MULTI_LINE)\n .build()\n```\n\n\n[See the full example](/maps/documentation/places/android-sdk/basic-place-autocomplete-ui-kit#example).\n\nCustomize the Basic Autocomplete component\n------------------------------------------\n\n### List density\n\n\nYou can choose to either display a two-line list or a multiline list. Use the options in `AutocompleteListDensity` (`TWO_LINE` or `MULTI_LINE`) in the [`AutocompleteUICustomization`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/widget/model/AutocompleteUiCustomization) class. If you don't specify the list density, the component will display a two-line list.\n\n### Location icon\n\n\nYou can choose whether to display a default place icon on the results list. Use the options in `AutocompleteUIIcon` (`listItemDefaultIcon` or `noIcon`) in the [`AutocompleteUICustomization`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/widget/model/AutocompleteUiCustomization) class.\n\n### Add customizations to the Basic Autocomplete component\n\n\nUse the [`AutocompleteUICustomization`](/maps/documentation/places/android-sdk/reference/com/google/android/libraries/places/widget/model/AutocompleteUiCustomization) class to customize the Basic Autocomplete component. \n\n### Kotlin\n\n```kotlin\n.setAutocompleteUiCustomization(\n AutocompleteUiCustomization.create(\n listDensity = AutocompleteListDensity.MULTI_LINE,\n listItemIcon = AutocompleteUiIcon.noIcon(),\n )\n)\n```\n\n### Java\n\n```java\n.setAutocompleteUiCustomization(\n AutocompleteUiCustomization.builder()\n .listItemIcon(AutocompleteUiIcon.noIcon())\n .listDensity(AutocompleteListDensity.MULTI_LINE)\n .build()\n)\n```\n\nExample\n-------\n\n\nThis example creates a custom Basic Autocomplete component. \n\n### Kotlin\n\n```kotlin\n val basicPlaceAutocompleteActivityResultLauncher:\n ActivityResultLauncher\u003cIntent\u003e =\n registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {\n result: ActivityResult -\u003e\n val intent = result.data\n val place: Place? = BasicPlaceAutocomplete.getPlaceFromIntent(intent!!)\n val status: Status? = \n BasicPlaceAutocomplete.getResultStatusFromIntent(intent!!)\n // ...\n }\n \n val autocompleteIntent: Intent =\n BasicPlaceAutocomplete.createIntent(this) {\n setInitialQuery(\"INSERT_QUERY_TEXT\")\n setOrigin(LatLng(10.0, 10.0))\n // ...\n \n setAutocompleteUiCustomization(\n AutocompleteUiCustomization.create(\n listDensity = AutocompleteListDensity.MULTI_LINE,\n listItemIcon = AutocompleteUiIcon.noIcon(),\n )\n )\n }\n \n basicPlaceAutocompleteActivityResultLauncher.launch(autocompleteIntent)\n```\n\n### Java\n\n```java\n ActivityResultLauncher\u003cIntent\u003e basicPlaceAutocompleteActivityResultLauncher =\n registerForActivityResult(\n new ActivityResultContracts.StartActivityForResult(),\n new ActivityResultCallback\u003cActivityResult\u003e() {\n @Override\n public void onActivityResult(ActivityResult result) {\n Intent intent = result.getData();\n if (intent != null) {\n Place place =\n BasicPlaceAutocomplete.getPlaceFromIntent(intent);\n Status status =\n BasicPlaceAutocomplete.getResultStatusFromIntent(intent);\n //...\n }\n }\n }\n );\n \n Intent basicPlaceAutocompleteIntent =\n new BasicPlaceAutocomplete.IntentBuilder()\n .setInitialQuery(\"INSERT_QUERY_TEXT\")\n .setOrigin(new LatLng(10.0, 10.0))\n //...\n \n .setAutocompleteUiCustomization(\n AutocompleteUiCustomization.builder()\n .listItemIcon(AutocompleteUiIcon.noIcon())\n .listDensity(AutocompleteListDensity.MULTI_LINE)\n .build())\n .build(this);\n \n basicPlaceAutocompleteActivityResultLauncher.launch(basicPlaceAutocompleteIntent);\n```"]]