When calling an activity from a watch face, the watch face continues to run in the emulator, but stops in a physical watch. Why?

48 views Asked by At

I am developing a watch face. In the emulator, I can call a new transparent activity and the watch face continues to execute. But in a physical watch with Wear OS (the Galaxy Watch4), the execution stops completely and the graphics of the watch face disappear. Why? Is there a way to avoid this from happening?

This is my code that calls the transparent activity:

val intent = Intent(context, MyActivity::class.java)
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
context.startActivity(intent)
1

There are 1 answers

0
go3d On

I was able to solve the issue by adding a translucent theme in the activity section of the AndroidManifest.xml file:

<activity
  android:name=".MyActivity"
  android:exported="true"
  android:theme="@android:style/Theme.Translucent.NoTitleBar"/>

Also, looks like exported="true" is needed as well.

Not sure why it does work in the emulator without these adjustments, perhaps because the Wear OS API version of the emulator is 28, and in the Galaxy Watch4 it is 30.