Catch PackageManager$NameNotFoundException
This commit is contained in:
parent
fb41d3e2ab
commit
0b5ba802db
@ -121,12 +121,16 @@ fun rememberSplashScreenData(searchable: SavableSearchable?): SplashScreenData {
|
|||||||
}
|
}
|
||||||
} ?: return@withContext
|
} ?: return@withContext
|
||||||
val themeRes = activityInfo.themeResource
|
val themeRes = activityInfo.themeResource
|
||||||
val ctx = context.createPackageContext(
|
val ctx = try {
|
||||||
|
context.createPackageContext(
|
||||||
searchable.`package`,
|
searchable.`package`,
|
||||||
Context.CONTEXT_IGNORE_SECURITY
|
Context.CONTEXT_IGNORE_SECURITY
|
||||||
)
|
)
|
||||||
ctx.setTheme(themeRes)
|
} catch (e: PackageManager.NameNotFoundException) {
|
||||||
|
return@withContext
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.setTheme(themeRes)
|
||||||
val theme = ctx.theme
|
val theme = ctx.theme
|
||||||
|
|
||||||
val typedValue = TypedValue()
|
val typedValue = TypedValue()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user