Short verson
Is this allowed or do I need to use a UI thread?
EDIT: A link to a place in Android white papers would be perfect.
Long version
Android docs clearly state that they are not allowed to "access the Android UI toolkit from outside the user interface."
On the other hand, the creation of Bitmap objects from workflows is apparently allowed, at least this is done in the code example: http://developer.android.com/guide/topics/fundamentals/processes-and-threads.html Apparently, the Bitmap class is not considered part of the "user interface toolkit" in relation to streaming.
I have a piece of code that seems to work when called from a thread other than ui. It includes the use of Bitmap.createBitmap (int, int, Bitmap.Config), the new Canvas (bitmap), Typeface.create (), and a text drawing. My code does not reference any View object.
Can someone point me to the part of the documentation that says I can do this from a background thread? Or will it lead to random crashes?
source share