Hello! New Connect IQ developer here — I'm working on a watch face which a) uses a full-screen bitmap as its background, and b) also provides a custom goal view containing its own bitmap. Having both bitmaps loaded at once causes an out-of-memory crash, so I'm trying to figure out how to properly load and unload these bitmaps dynamically.
My current technique works in the simulator, but crashes on my Vivoactive 3 with a generic "unhandled exception" error message. Specifically, I have an uninitialized <drawable class="WatchUi.Bitmap" /> in my watch face's layout, and during onShow(), I call (theBackgroundDrawable as Bitmap).setBitmap(Rez.Drawables.Background). Then, in onHide(), I call (theBackgroundDrawable as Bitmap).setBitmap(null).
Upon further investigation, the WatchUi.Bitmap docs do specify that "A null
value passed for the bitmap parameter is only supported with ConnectIQ 5.0.0 and later." So, is unloading a bitmap simply unsupported in earlier CIQ versions? If not, what other techniques am I missing?
(Also, why does this work in the simulator, even on a pre-5.0.0 device? Shouldn't the simulator provide an appropriately versioned backend?)