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

python 3.x - Mapping specific letters onto a list of words -

javascript - jquery or ashx not working -

inno setup - TLabel or TNewStaticText - change .Font.Style on Focus like Cursor changes with .Cursor -