Advertisement
Guest User

wowgarmin

a guest
Jan 9th, 2025
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. function onReceiveImage(responseCode as Number, data as Null or BitmapReference or BitmapResource) as Void {
  2. System.println("onReceiveImage: response code = " + responseCode);
  3. if (responseCode == 200 && data != null) {
  4. // Storage.setValue(bitmapKey, data); // generates warning/error at typecheck level 2/3
  5.  
  6. // a spurious cast is required to make the type checker happy (arguably this type of cast
  7. // is bad because it should be used sparingly - or not at all, and it gives the dev
  8. // a false sense of security)
  9. Storage.setValue(bitmapKey, data as BitmapResource);
  10. }
  11. Background.exit(responseCode);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement