Google Map v2, Autocomplete is not working
Google Map v2, Autocomplete is not working
Every time I try to search a place, my autocomplete doesn't work.
Android Monitor:
My XML:
<android.support.v7.widget.GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:alignmentMode="alignBounds"
app:orientation="horizontal"
android:padding="16dp"
app:useDefaultMargins="true"
app:columnCount="1" >
<TextView
android:id="@+id/from_label"
app:layout_gravity="fill_horizontal"
android:text="@string/from"
android:textColor="?android:textColorSecondary" />
<com.ecs.google.maps.v2.fragment.CustomAutoCompleteTextView
android:id="@+id/from"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
/>
<TextView
android:id="@+id/to_label"
app:layout_gravity="fill_horizontal"
android:text="@string/to"
android:textColor="?android:textColorSecondary" />
<com.ecs.google.maps.v2.fragment.CustomAutoCompleteTextView
android:id="@+id/to"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
/>
<Button
android:id="@+id/load_directions"
app:layout_columnSpan="@integer/create_account_pane_column_count"
app:layout_gravity="fill_horizontal"
android:text="@string/load_directions" />
</android.support.v7.widget.GridLayout>
AndroidManifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.kixkikx.testzng">
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<permission
android:name="com.ecs.google.maps.v2.actionbarsherlock.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.mapdemo.permission.MAPS_RECEIVE" />
<!-- Network connectivity permissions -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- Access Google based webservices -->
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.Sherlock.Light" >
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyDK1zxUEp38e6sQYzJq6qGNKxdOUqUZR1Y"/>
<uses-permission android:name="android.permission.INTERNET"/>
<activity
android:name="com.ecs.google.maps.v2.actionbarsherlock.TabbedActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.ecs.google.maps.v2.fragment.DirectionsInputActivity"
android:label="@string/directions_input" >
</activity>
</application>
</manifest>
1 Answer
1
Well, make sure you enabled both Google Places API for Android and Google Places API Web Service in your Developer Console. Because sometimes it is the issue why the autocomplete doesn't work. Also, try to use a browser key with this. Reference: Google maps API auto complete is not working
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.