Skip to content

Commit 4cdc2ad

Browse files
committed
Add comment for Retrofit async OkHttp
Change-Id: Ic7a6887b76caf26f00b58b0753271d426b67e75b
1 parent d110d92 commit 4cdc2ad

File tree

1 file changed

+2
-0
lines changed
  • core/network/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/retrofit

1 file changed

+2
-0
lines changed

core/network/src/main/kotlin/com/google/samples/apps/nowinandroid/core/network/retrofit/RetrofitNiaNetwork.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ internal class RetrofitNiaNetwork @Inject constructor(
8080
private val networkApi = trace("RetrofitNiaNetwork") {
8181
Retrofit.Builder()
8282
.baseUrl(NIA_BASE_URL)
83+
// We use callFactory lambda here with dagger.Lazy<Call.Factory>
84+
// to prevent initializing OkHttp on the main thread.
8385
.callFactory { okhttpCallFactory.get().newCall(it) }
8486
.addConverterFactory(
8587
networkJson.asConverterFactory("application/json".toMediaType()),

0 commit comments

Comments
 (0)