image-load

Android OutOfMemoryError:?

∥☆過路亽.° 提交于 2019-11-26 08:08:18
问题 I am sporadically getting an OutOfMemoryError: (Heap Size=49187KB, Allocated=41957KB) in one of my apps. What can I do to diagnose this? 01-09 10:32:02.079: E/dalvikvm(8077): Out of memory: Heap Size=49187KB, Allocated=41957KB, Limit=49152KB 01-09 10:32:02.079: E/dalvikvm(8077): Extra info: Footprint=48611KB, Allowed Footprint=49187KB, Trimmed=7852KB 01-09 10:32:02.079: D/skia(8077): --- decoder->decode returned false 01-09 10:32:02.079: D/AndroidRuntime(8077): Shutting down VM 01-09 10:32:02

Detect image load

半城伤御伤魂 提交于 2019-11-26 04:18:34
问题 Is it possible to detect once an image has been loaded with jQuery? 回答1: You can use the .load() event handler, like this: $("#myImg").load(function() { alert('I loaded!'); }).attr('src', 'myImage.jpg'); Be sure to attach it before setting the source, or the event may have fired before you attached a handler to listen for it (e.g. loading from cache). If that's not doable (setting the src after binding), be sure to check if it's loaded and fire it yourself, like this: $("#myImg").load