我试图将LocationUpdate作为服务(来自Play Services v7),我有这样的错误:
Unable to start service com.package.etcetc... GoogleApiClient is not connected yet.
这是我的机器清单:
...
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".LocationService"
android:enabled="true" />
</application>
...
MainActivity调用服务:
startService(new Intent(MainActivity.this, LocationService.class));
这是我的完整java代码:http://pastebin.com/hgjKKmMr
有任何建议吗?