Paul Clapham wrote:Hi Sahar, welcome to the Ranch!
If I was the one who got that message "Can't create handler inside thread that has not called Looper.prepare()" then my first idea would be to have my thread call Looper.prepare(). Probably near the beginning, because "prepare" sounds like the sort of thing which should be done at the beginning. I'd suggest trying that.
Hi Paul, Thanks for your response.
I tried at first to put Looper.prepare (): before while but it did not help
I think I need to use Thread and Handler with getMainLooper but I do not have any idea how to combine them together
You have an idea?