Я хочу реализовать автозаполнение сайта google API в android. Для этого мне нужно создать объект GoogleApiClient. Я использовал следующий код для этого ...Ошибка создания объекта GoogleApiClient, дает java.lang.IllegalStateException: уже управляет GoogleApiClient с идентификатором 0
private GoogleApiClient mGoogleApiClient;
mGoogleApiClient = new GoogleApiClient.Builder(getActivity())
.addApi(Drive.API)
.addScope(Drive.SCOPE_FILE)
.enableAutoManage(getActivity(), 0 /* clientId */, this)
.addConnectionCallbacks(this)
.addOnConnectionFailedListener(this)
.build();
Но когда начинается фрагмент, он бросает следующее исключение и приложение разбилось.
java.lang.IllegalStateException: Уже управление GoogleApiClient с идентификатором 0
Примечание: это выполняется в ФРАГМЕНТ.
Ниже манифеста конфигурационный файл ..
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="com.example.permission.MAPS_RECEIVE"/>
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:name="com.example.bluehorsesoftkol.ekplatevendor.Utils.EkPlateVendorApplication">
<activity
android:name="com.example.bluehorsesoftkol.ekplatevendor.activity.registration.ActivitySplashScreen"
android:label="@string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.bluehorsesoftkol.ekplatevendor.activity.registration.ActivityLogin"
android:screenOrientation="landscape">
</activity>
<activity
android:name=".activity.vendor.ActivityHome"
android:screenOrientation="landscape">
</activity>
<activity android:name="com.example.bluehorsesoftkol.ekplatevendor.activity.vendor.ActivityAddVendor"
android:screenOrientation="landscape">
</activity>
<activity
android:name=".activity.vendor.CustomGalleryActivity"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="ekplatevendor.ACTION_PICK" />
<action android:name="ekplatevendor.ACTION_MULTIPLE_PICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="@string/TEST_API_KEY"/>
</application>
Так, пожалуйста, помогите решить эту проблему ..
Спасибо.