So, the following code
if (data.isEmpty()) {
gives:
Error: Array Out Of Bounds Error
when it's "Lang.Dictionary {size: 0}"
Similarly,
if (data.size() == 0) {
Also gave the same error.
So what can I do to test its size so it doesn't crash?!?
So, the following code
if (data.isEmpty()) {
gives:
Error: Array Out Of Bounds Error
when it's "Lang.Dictionary {size: 0}"
Similarly,
if (data.size() == 0) {
Also gave the same error.
So what can I do to test its size so it doesn't crash?!?
The var type = data.keys()[0];
was from the original developer. I assume he was expecting just one web request data to be returned at a time but I now piggy back two of them together. I'm now iterating…
If it's not 200 it will be null in many cases/devices, but in that case, onBackgroundData won't be called so your main app doesn't see it.
Your best option would be to use a try / catch for Application.ObjectStoreAccessException.
The one that has most impact is the bkgnd32kb/bkgnd64kb exclusion
Maybe, but the makeImageRequest not working in the background past CIQ 3 is a show stopper for me not releasing my watch face. Somehow storage works between background and watch face, so it sure looks like they could make it work if they cared to.
If they cared, they would also fix makeWebRequest returning (sometimes) a Dictionary while you asked for
HTTP_RESPONSE_CONTENT_TYPE_TEXT_PLAIN
I have to type check the return data and act accordingly, increasing for no good reason the size of the code.