i have prepared paint application,my application contains one custom view for paint.when we draw any thing in custom view just collect the drawn pixels and store in array li
Your application is bound to get "Application not responding" errors since you're doing all your computation, including allocation in the UI thread (onDraw
).
Firstly, you should try moving the computations into a non-ui thread (see AsyncTask). Any operation that is taking more than 20ms is bound to invoke the "Application Not responding" message.
Secondly, you should try and refactor your code such that you do not have to perform the computation every time you have to draw. Basically render your image is an off screen bitmap, cache it and render it from the cached copy in onDraw
. The scope of "how to", I'm afraid, is beyond the scope of this discussion.