Per requirement WO-V15 in Wear OS App Quality guidelines, and as a requirement to get published by the PlayStore, Wear OS apps now need to integrate with splash screen. Following instructions for adding the splash screen (here), and following instructions to use WearableListenerService (here), it turns out that when the app is invoked via the call to WearableListenerService, the splash screen does indeed NOT show. Even if the onCreate gets called. What is the solution to get the splash screen created if the app is invoked via the listener service?
Thank you
Code snippets here:
class WearableDataService : WearableListenerService() {
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate)
private val exerciseServiceRepository: ExerciseServiceRepository by inject()
private val hapticFeedbackHelper: HapticFeedbackHelper by inject()
@RequiresApi(Build.VERSION_CODES.S)
override fun onDataChanged(dataEvents: DataEventBuffer) {
dataEvents.forEach { dataEvent ->
val uri = dataEvent.dataItem.uri
when (uri.path) {
WORKOUT_STATUS_PATH -> {
val item = DataMapItem.fromDataItem(dataEvent.dataItem)
item.dataMap.getByteArray(STATUS_DATA)?.let {
it.toWorkoutStatusUpdate().let { statusUpdate ->
scope.launch {
exerciseServiceRepository.updateWorkoutStatus(workoutStatusUpdate)
}
notifyUserWithVibrationThatSomethingHasChanged()
}
}
}
}
}
dataEvents.release()
super.onDataChanged(dataEvents)
}
}
Splash screen implementation:
override fun onCreate(savedInstanceState: Bundle?) {
// Handle the splash screen transition.
val splash = installSplashScreen()
super.onCreate(savedInstanceState)
Including Manifest Implementations:
<activity
android:name=".wearOs.MainActivity"
android:exported="true"
android:theme="@style/Theme.Starting"
android:taskAffinity=".wearOs">