android - getDrawingCache causes app to freeze -


my app freezing on initialization. have narrowed down related getdrawingcache() call in snippet.. when take out, problem disappears.

public shot getscreenshot(view view) throws drawingcacheexception {     view.setdrawingcacheenabled(true);     bitmap bitmap;     try {         bitmap drawingcache = view.getdrawingcache();         if (drawingcache == null) {             throw new drawingcacheexception("cannot bitmap drawing cache");         }          bitmap = bitmap.createbitmap(drawingcache);     } {         view.setdrawingcacheenabled(false);     }     //do postprocessing } 

the problem context. working, , haven't touched code @ all, did refactor class called it.

and before mentions it, yes, running on activity's ui thread. i've quadruple-checked.

so, interacting code cause freeze?

the problem screenshotting, encoding afterwards, slow freezing app. not happening often, increasing delay fixed problem. time work on perf!


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -