use gsonfactory instead of jacksonfactory at fetching Google Events

This commit is contained in:
tibbi 2017-01-30 21:34:27 +01:00
parent 2ab9ad73bd
commit 7f2a298092
1 changed files with 2 additions and 3 deletions

View File

@ -5,7 +5,7 @@ import android.os.AsyncTask
import com.google.api.client.extensions.android.http.AndroidHttp import com.google.api.client.extensions.android.http.AndroidHttp
import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential import com.google.api.client.googleapis.extensions.android.gms.auth.GoogleAccountCredential
import com.google.api.client.googleapis.extensions.android.gms.auth.UserRecoverableAuthIOException import com.google.api.client.googleapis.extensions.android.gms.auth.UserRecoverableAuthIOException
import com.google.api.client.json.jackson2.JacksonFactory import com.google.api.client.json.gson.GsonFactory
import com.google.api.client.util.DateTime import com.google.api.client.util.DateTime
import com.google.api.services.calendar.model.Event import com.google.api.services.calendar.model.Event
import com.simplemobiletools.calendar.R import com.simplemobiletools.calendar.R
@ -18,8 +18,7 @@ class FetchGoogleEventsTask(val activity: Activity, credential: GoogleAccountCre
init { init {
val transport = AndroidHttp.newCompatibleTransport() val transport = AndroidHttp.newCompatibleTransport()
val jsonFactory = JacksonFactory.getDefaultInstance() service = com.google.api.services.calendar.Calendar.Builder(transport, GsonFactory(), credential)
service = com.google.api.services.calendar.Calendar.Builder(transport, jsonFactory, credential)
.setApplicationName(activity.resources.getString(R.string.app_name)) .setApplicationName(activity.resources.getString(R.string.app_name))
.build() .build()
} }