Skip to content

Commit 65ec774

Browse files
committed
Add provider in AndroidManifest file for initializing automatically
1 parent f5eb14d commit 65ec774

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727
<category android:name="android.intent.category.LAUNCHER" />
2828
</intent-filter>
2929
</activity>
30-
</application>
3130

31+
<provider
32+
android:name="androidx.startup.InitializationProvider"
33+
android:authorities="com.skydoves.pokedex.androidx-startup"
34+
android:exported="false"
35+
tools:node="merge">
36+
37+
<meta-data
38+
android:name="com.skydoves.pokedex.initializer.TimberInitializer"
39+
android:value="androidx.startup" />
40+
</provider>
41+
</application>
3242
</manifest>

app/src/main/java/com/skydoves/pokedex/PokedexApp.kt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,7 @@
1717
package com.skydoves.pokedex
1818

1919
import android.app.Application
20-
import androidx.startup.AppInitializer
21-
import com.skydoves.pokedex.initializer.TimberInitializer
2220
import dagger.hilt.android.HiltAndroidApp
2321

2422
@HiltAndroidApp
25-
class PokedexApp : Application() {
26-
27-
override fun onCreate() {
28-
super.onCreate()
29-
30-
AppInitializer.getInstance(this).initializeComponent(TimberInitializer::class.java)
31-
}
32-
}
23+
class PokedexApp : Application()

0 commit comments

Comments
 (0)