loloof64
04/20/2021, 8:52 AMMainActivity
the activity which defines the navigation, and TargetComposable
the composable of the pushed page. How can I force a reload of TargetComposable
when application is back in foreground ? Is using MainActivity
's onStart()
method mandatory (and can it lead to a kind a mess, coupled with Navigation) ? Or is there a simpler solution ?loloof64
04/20/2021, 9:29 AMloloof64
04/20/2021, 9:49 AMprintln
command is not triggered in such case inside the current page's Composable.loloof64
04/20/2021, 4:24 PMIan Lake
04/20/2021, 4:43 PMIan Lake
04/20/2021, 4:44 PMloloof64
04/20/2021, 5:09 PMloloof64
04/20/2021, 5:11 PMLazyColum
, each with two list of String I got from two different functions of my utility method.loloof64
04/20/2021, 5:12 PMIntent
for Chess OEX engine.loloof64
04/20/2021, 5:13 PMloloof64
04/20/2021, 5:15 PMloloof64
04/20/2021, 5:16 PMprintln
command seems to be always executed :
SideEffect {
println("Activating page again")
storeEngines = enginesUtils.getMyStoreEnginesNames()
}
Ian Lake
04/20/2021, 5:25 PMFlow<Array<String>>
that uses PackageManager
to observe additions and removals of packages. Then your UI would automatically recompose as that set of engines changeIan Lake
04/20/2021, 5:26 PMIntent
): https://github.com/muzei/muzei/blob/main/android-client-common/src/main/java/com/google/android/apps/muzei/room/InstalledProviders.ktIan Lake
04/20/2021, 5:28 PMloloof64
04/20/2021, 6:30 PMloloof64
04/20/2021, 6:31 PMSideEffect
block : but the fact is that for now, it causes a infinite recomposition loop. loloof64
04/20/2021, 6:43 PMstoreEngines
with a call to enginesUtils.getMyStoreEnginesNames()
.Ian Lake
04/20/2021, 6:55 PMloloof64
04/20/2021, 7:10 PMIan Lake
04/20/2021, 7:12 PMloloof64
04/20/2021, 7:17 PMPackageManager.queryIntentActivities()
in order to handle this loading (and the installation into the internal folder) properly. https://developer.android.com/reference/android/content/pm/PackageManager#queryIntentActivities(android.content.Intent,%20int)loloof64
04/21/2021, 1:04 PMfun getAvailableEngines(context: Context): Flow<List<ChessEngine>> = callbackFlow {
...
}
Is it then safe to include a call to getAvailableEngines()
in a saveable state ?
var storeEngines by remember { mutableStateOf(getAvailableEngines(currentContext)) }
Ian Lake
04/21/2021, 1:19 PMcollectAsState()
your Flowloloof64
04/21/2021, 8:55 PM