Status Update
Comments
da...@google.com <da...@google.com> #2
The code referred to can be found in
override fun onResume() {
super.onResume()
if (navigated) {
findNavController().popBackStack()
return
}
var monitor = installViewModel.installMonitor
if (monitor == null) {
Log.i(TAG, "onResume: monitor is null, navigating")
navigate()
monitor = installViewModel.installMonitor
}
if (monitor != null) {
Log.i(TAG, "onResume: monitor is now not null, observing")
monitor.status.observe(this, StateObserver(monitor))
}
}
In case no monitor is attached during onResume
, we assign the installMonitor
from installViewModel
.
In either case a new StateObserver
is attached, which then observes status changes.
Once SplitSessionInstallState.INSTALLED
is observed, navigate()
is invoked from within StateObserver
.
Since navigate
is called in the StateObserver we might see multiple invocations by accident.
To alleviate this, we could create a Event
Alternatively, moving the calls from onResume
earlier in the lifecycle, e.g. onCreateView
could avoid unnecessary view creation in case navigation already has taken place, and could avoid multiple calls to the observed status.
an...@gmail.com <an...@gmail.com> #3
Branch: androidx-master-dev
commit 29c5aee2bf2685e3bc2a0e38ca0290408aa65b11
Author: Ben Weiss <benweiss@google.com>
Date: Tue Nov 03 14:41:39 2020
Move install monitor observation to onViewCreated
Bug: 169636207
Test: Existing tests pass
Change-Id: Ia0c1d903066a5206de5b862eb2a0d9e0899c690b
M navigation/navigation-dynamic-features-fragment/src/main/java/androidx/navigation/dynamicfeatures/fragment/ui/AbstractProgressFragment.kt
ap...@google.com <ap...@google.com> #4
This has been fixed and will be available in an upcoming Navigation 2.3.2 release.
da...@google.com <da...@google.com> #5
#4 I think this fix break the behavior of DefaultProgressFragment, it doesn't call super.onViewCreated() so that the installation won't execute.
st...@gmail.com <st...@gmail.com> #6
onViewCreated
Can you provide more information as to how your installation won't execute?
Description
Room integrated and working well, adding new date-related queries; these two are fine:
@Query("SELECT DISTINCT strftime('%Y-%m-%d', dateIso8601)...
@Query("SELECT DISTINCT strftime('%m-%d', dateIso8601)...
but attempting to use just the day field, fails to build:
@Query("SELECT DISTINCT strftime('%d', dateIso8601)...
Build error looks like
e: [kapt] An exception occurred: java.util.IllegalFormatConversionException: d != [Ljava.lang.Object;
at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4302)
at java.util.Formatter$FormatSpecifier.printInteger(Formatter.java:2793)
at java.util.Formatter$FormatSpecifier.print(Formatter.java:2747)
at java.util.Formatter.format(Formatter.java:2520)
at java.util.Formatter.format(Formatter.java:2455)
at java.lang.String.format(String.java:2940)
at androidx.room.log.RLog.safeFormat(RLog.kt:40)
at androidx.room.log.RLog.w(RLog.kt:68)
at androidx.room.solver.query.result.PojoRowAdapter.<init>(PojoRowAdapter.kt:74)
at androidx.room.solver.TypeAdapterStore$findRowAdapter$1.invoke(TypeAdapterStore.kt:345)
at androidx.room.solver.TypeAdapterStore$findRowAdapter$1.invoke(TypeAdapterStore.kt:82)
at androidx.room.processor.Context.collectLogs(Context.kt:86)
at androidx.room.solver.TypeAdapterStore.findRowAdapter(TypeAdapterStore.kt:338)
at androidx.room.solver.TypeAdapterStore.findQueryResultAdapter(TypeAdapterStore.kt:305)
at androidx.room.solver.binderprovider.RxCallableQueryResultBinderProvider.provide(RxCallableQueryResultBinderProvider.kt:39)
at androidx.room.solver.TypeAdapterStore.findQueryResultBinder(TypeAdapterStore.kt:272)
at androidx.room.processor.QueryMethodProcessor.process(QueryMethodProcessor.kt:107)
at androidx.room.processor.DaoProcessor.process(DaoProcessor.kt:95)
at androidx.room.processor.DatabaseProcessor.doProcess(DatabaseProcessor.kt:93)
at androidx.room.processor.DatabaseProcessor.process(DatabaseProcessor.kt:53)
at androidx.room.RoomProcessor$DatabaseProcessingStep.process(RoomProcessor.kt:57)
at com.google.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:318)
at com.google.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:171)
at org.jetbrains.kotlin.kapt3.base.ProcessorWrapper.process(annotationProcessing.kt:99)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor(JavacProcessingEnvironment.java:794)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:705)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1068)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing(annotationProcessing.kt:55)
at org.jetbrains.kotlin.kapt3.base.AnnotationProcessingKt.doAnnotationProcessing$default(annotationProcessing.kt:27)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.runAnnotationProcessing(Kapt3Extension.kt:218)
at org.jetbrains.kotlin.kapt3.AbstractKapt3Extension.analysisCompleted(Kapt3Extension.kt:183)
at org.jetbrains.kotlin.kapt3.ClasspathBasedKapt3Extension.analysisCompleted(Kapt3Extension.kt:100)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM$analyzeFilesWithJavaIntegration$2.invoke(TopDownAnalyzerFacadeForJVM.kt:95)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:105)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:82)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:375)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:67)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:107)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:366)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:120)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:161)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:57)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:96)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.java:52)
at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:93)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:442)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$compile$1$1$2.invoke(CompileServiceImpl.kt:102)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:1029)
at org.jetbrains.kotlin.daemon.CompileServiceImpl$doCompile$$inlined$ifAlive$lambda$2.invoke(CompileServiceImpl.kt:102)
at org.jetbrains.kotlin.daemon.common.DummyProfiler.withMeasure(PerfUtils.kt:137)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.checkedCompile(CompileServiceImpl.kt:1071)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.doCompile(CompileServiceImpl.kt:1028)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:441)
at sun.reflect.GeneratedMethodAccessor106.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:346)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)