[android-developers] need thread on UI / lifecycle Gotchas

2011-08-19 Thread cellurl
I keep getting told that my code violates the UI and lifecycle rules and I have no idea how to find/fix it. I first read this: http://developer.android.com/guide/topics/fundamentals/processes-and-threads.html Then, I figured I needed to replace things like this:

Re: [android-developers] need thread on UI / lifecycle Gotchas

2011-08-19 Thread Mark Murphy
On Fri, Aug 19, 2011 at 1:45 PM, cellurl gpscru...@gmail.com wrote: I keep getting told that my code violates the UI and lifecycle rules and I have no idea how to find/fix it. Who is telling you this? Then, I figured I needed to replace things like this:

Re: [android-developers] need thread on UI / lifecycle Gotchas

2011-08-19 Thread Miguel Morales
Well, if you use findViewById() in a thread, that's plain out wrong. The function you posted seems wrong in that it first makes a UI call in that thread context. Then it attempts to use a queue to post a runnable to so that setText() runs in the UI thread. It's redundant if it's already in the UI