I\'m making a simple place picker program in android and the problem is when I click on button the place picker opens and automatically closes after 2 - 3 seconds... please help
I ran your code and configuration, and saw the same behavior that you were seeing.
After comparing your configuration to one that I had working, I realized that the issue is that in your AndroidManifest.xml, you need to change this:
android:name="com.google.android.maps.v2.API_KEY"
To this:
android:name="com.google.android.geo.API_KEY"
I went back and tested multiple times with both configurations just to make sure that this was what was causing your issue. Using the first configuration, the PlacePicker closes immediately every time.
Using com.google.android.geo.API_KEY
, it works perfectly every time.
This is also what the documentation states you need to use for the Places API.
Result of testing with your code, and the one modification needed to make it work:
After picking a Place: