0
每當我嘗試搜索地點時,我的自動完成功能都無法使用。Google地圖v2,自動完成功能無法正常工作
的Android顯示器:http://imgur.com/a/kwjEO
我DirectionInputActivity.java(我的自動完成代碼):http://paste.ofcode.org/DDy4zTiLR9jazaCq8KHA2Y
我的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" />
AndroidManifest:`
<!--
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>
`