has places api got deprecated???
Java
// Set the fields to specify which types of place data to return.
List<Place.Field> fields = Arrays.asList(Place.Field.ID, Place.Field.NAME);
// Start the autocomplete intent.
Intent intent = new Autocomplete.IntentBuilder(
AutocompleteActivityMode.FULLSCREEN, fields)
.build(this);
startActivityForResult(intent, AUTOCOMPLETE_REQUEST_CODE);
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == AUTOCOMPLETE_REQUEST_CODE) {
if (resultCode == RESULT_OK) {
Place place = Autocomplete.getPlaceFromIntent(data);
Log.i(TAG, "Place: " + place.getName() + ", " + place.getId());
} else if (resultCode == AutocompleteActivity.RESULT_ERROR) {
// TODO: Handle the error.
Status status = Autocomplete.getStatusFromIntent(data);
Log.i(TAG, status.getStatusMessage());
} else if (resultCode == RESULT_CANCELED) {
// The user canceled the operation.
}
}
} // Add an import statement for the client library.
import com.google.android.libraries.places.api.Places;
// Initialize Places.
Places.initialize(getApplicationContext(), "***YOUR API KEY***");
// Create a new Places client instance.
PlacesClient placesClient = Places.createClient(this);
Also in Java:
- Title
- how to get elements of a list in java
- Category
- Java
- Title
- how to delete character in string java
- Category
- Java
- Title
- Java nested array hashcode
- Category
- Java
- Title
- object orientation in java
- Category
- Java
- Title
- java animated gif example
- Category
- Java
- Title
- java bigdecimal compareto
- Category
- Java
- Title
- java 8 function supplier consumer
- Category
- Java
- Title
- java list to array
- Category
- Java
- Title
- generate random number java
- Category
- Java
- Title
- Write a method that raises a number to a power without using Math.pow() method
- Category
- Java
- Title
- fibonacci sequence in java recursion
- Category
- Java
- Title
- java s3 images
- Category
- Java
- Title
- java shortest if else statement
- Category
- Java
- Title
- java packages example
- Category
- Java
- Title
- how do you concatenate an int with a string in java
- Category
- Java
- Title
- ndroid.support.v4.content.FileProvider
- Category
- Java
- Title
- java uuid
- Category
- Java
- Title
- nikita kaksharov
- Category
- Java
- Title
- how to open a webpage with java
- Category
- Java
- Title
- java how to print an array
- Category
- Java
- Title
- determine if a given binary tree is a valid bst
- Category
- Java
- Title
- find maven version
- Category
- Java
- Title
- java regex replace all characters before
- Category
- Java
- Title
- room insert and return id
- Category
- Java
- Title
- how to loop trough an object java script
- Category
- Java
- Title
- java 8 hashmap example stackoverflow
- Category
- Java
- Title
- sdkmanager JAVA_HOME invalid directory
- Category
- Java
- Title
- java get annotation value
- Category
- Java
- Title
- rewrite file java
- Category
- Java
- Title
- write an object java in a file
- Category
- Java
- Title
- how to write sensor data into file android studio
- Category
- Java
- Title
- run spring boot application command line
- Category
- Java
- Title
- how to make a char uppercase in java
- Category
- Java
- Title
- how to delete an element from an array in java
- Category
- Java
- Title
- java pass arraylist by value
- Category
- Java
- Title
- show menuitem when menu hovered javafx
- Category
- Java
- Title
- java d'intervalle de resultat
- Category
- Java
- Title
- iterate through hashtable java
- Category
- Java
- Title
- find the triplet sum in java linked list
- Category
- Java
- Title
- java last element in array
- Category
- Java
- Title
- vector length java
- Category
- Java
- Title
- how to show the hex detail of a file in java
- Category
- Java
- Title
- create jdbc connection in java
- Category
- Java
- Title
- arraylist add method
- Category
- Java
- Title
- java min function
- Category
- Java
- Title
- init admob
- Category
- Java
- Title
- get preference value android
- Category
- Java
- Title
- how to detect device javascirpt
- Category
- Java
- Title
- place.getlatlng() returning null
- Category
- Java
- Title
- numberformatexception
- Category
- Java
- Title
- add one character to string java
- Category
- Java
- Title
- Java how to copy file
- Category
- Java
- Title
- reading in lines from a file java
- Category
- Java
- Title
- how to test how many of one character is in a string java
- Category
- Java
- Title
- compile java to jar in mac
- Category
- Java
- Title
- java jagged array days and months
- Category
- Java
- Title
- how to read in a file in java
- Category
- Java
- Title
- j
- Category
- Java
- Title
- output statement java
- Category
- Java
- Title
- java linked list functions
- Category
- Java
- Title
- java "->"
- Category
- Java
- Title
- java permutation
- Category
- Java
- Title
- get last element of array java
- Category
- Java
- Title
- pascals triangle java
- Category
- Java
- Title
- kotlin android intent pass data
- Category
- Java
- Title
- read csv in java in spring
- Category
- Java
- Title
- install java debian 8
- Category
- Java
- Title
- change the value in a hashtable java
- Category
- Java
- Title
- connecting to h2 database from java
- Category
- Java
- Title
- convert list to array in java
- Category
- Java
- Title
- can we overload a static method in java
- Category
- Java
- Title
- converting char array to string
- Category
- Java
- Title
- javafx textarea size
- Category
- Java
- Title
- NumSelfDivisors java
- Category
- Java
- Title
- java final meaning
- Category
- Java
- Title
- java how to convert string to int
- Category
- Java
- Title
- java constructor genertic
- Category
- Java
- Title
- 3-way radix quicksort java
- Category
- Java
- Title
- how to print ascii value in java
- Category
- Java
- Title
- stack overflow recyclerview
- Category
- Java
- Title
- java file download
- Category
- Java
- Title
- java create circle
- Category
- Java
- Title
- entre clavier java
- Category
- Java
- Title
- convert array of int to arraylist java
- Category
- Java
- Title
- java square a number
- Category
- Java
- Title
- formatting an integer in java
- Category
- Java
- Title
- java how to call getReader twice
- Category
- Java
- Title
- java get first char
- Category
- Java
- Title
- java stack pop
- Category
- Java
- Title
- check if map contains key java
- Category
- Java
- Title
- same method name with different arguments
- Category
- Java
- Title
- java for each
- Category
- Java
- Title
- create color object java
- Category
- Java
- Title
- java stream to list
- Category
- Java
- Title
- sign flutter app android studio
- Category
- Java
- Title
- java identifiers
- Category
- Java
- Title
- hibernate onetone with mapsid
- Category
- Java
- Title
- even or odd in java
- Category
- Java
- Title
- java main method
- Category
- Java
- Title
- treemap get order java
- Category
- Java