Problems when testing an project in the companion: onResume and BackPressed


I try to develop an extension. This works fine when I build and download an app (.apk file). But crashes when using the companion. It seems that the "onResume" callback of the extension is not triggered when using the companion. I used "adb logcat" to verify this. There is the expected message when using the apk but no one when testing with companion.

2nd: Having an app with two screen and testing it with the companion. Screen1 opens Screen2 via a button click. If you press the back tab on Screen2 the companion stopps. But it should return to Screen1 as the apk does.


Try this (it should also work with Comanion):

Check this: switchScreens.aia (9.2 KB)

Companion cannot open more that one screen, so if you press the device back button Comanion is stopped.

Specifically, the companion is a single screen that simulates multiple screens by having the browser switch to the second screen and send code that redraws the companion screen to reflect the new screen. This is different than how a compiled app operates where each screen is a unique object.

1 Like