More publishers trust us to engage, grow, and understand their audiences than any other. Build your on-site community with Disqus.
Processing Bitmaps Off the UI Thread ã®å 容ã«è£è¶³ãä»ãã¦è§£èª¬ãã¦ã¾ãã ååã®ã¨ã³ããªã¼ã§å¤§ããç»åãå¹æçã«èªãè¾¼ãæ¹æ³ã解説ãã¾ãããããã³ã¼ããããã¼ã¿ããã£ã¹ã¯ããããã¯ã¼ã¯ã«ããå ´åãBitmapFactory ã® decode* ã¡ã½ãã㯠UI ã¹ã¬ããã§è¡ã£ã¦ã¯ããã¾ããï¼ã¨ãããã¡ã¢ãªä¸ä»¥å¤ã®ãã¼ã¿ãèªã¿è¾¼ãå ´åã¯å ¨é¨ã ãï¼ã ãããã®å¦çã¯ãã£ã¹ã¯ããããã¯ã¼ã¯ã®ã¹ãã¼ããç»åã®ãµã¤ãºãCPUã®ãã¯ã¼ãªã©ãã¾ãã¾ãªè¦å ã§å®äºã¾ã§ã®æéãå¤ããããã¤å®äºããã®ããããã¾ããã ããç»åã®ãã³ã¼ãå¦ç㧠UI ã¹ã¬ããããããã¯ãã¦ãã¾ãã¨ãææª ANR ãçºçãã¾ãã ããã§ãAsyncTask ã使ã£ã¦ããã¯ã°ã©ã³ã㧠Bitmap ãèªã¿è¾¼ãããã«ãã¾ãã â AsyncTask ã使ã ç¹ã«ä½ãèããªãã§ä½ãã¨ããã£ã¨ãããªæã
ã»å¤§ããç»åãå¹æçã«èªã¿è¾¼ã ã»ããã¯ã°ã©ã¦ã³ã㧠Bitmap ãå¦çãã ã»Bitmap ããã£ãã·ã¥ãã ãã¾ã¨ãã¦ãDiskLruCache ã¨ã㦠Displaying Bitmaps Efficiently ã®ãµã³ãã« BitmapFun.zip ã® DiskLruCache.java ããã¼ã¹ã«ããã³ã¼ãã github ã«å ¬éãã¾ãããGoogle I/O 2012 ã®ã³ã¼ããåèã«ãã¦ãã¾ãã github - yanzm/ImageLoadLib - ç¹å¾´ã¯ API Level 4 ãã使ããããã«ãã¦ãããã¨ã§ãï¼BitmapFun ã Google I/O 2012 ã®ã³ã¼ãã¯ãããªã£ã¦ãã¾ããï¼ã ãããªæãã§ä½¿ãã¾ãã private ImageFetcher mImageFetcher; @Override public void onCreate(Bund
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}