开发者

Android: not abe to find Looper.quit()

开发者 https://www.devze.com 2023-01-19 09:31 出处:网络
The title explains it all. I have a class that extends AsyncTask. I call it directly in main thread using new classname.execute().

The title explains it all. I have a class that extends AsyncTask. I call it directly in main thread using new classname.execute().

Now in the doInBackground(params) i have Looper.prepare. Since i am getting an error "Only one Looper may be created per thread", i need to use Looper.quit() inside it. But i am not able to find it inside Looper class when i write Lo开发者_JS百科oper.quit();

So how to use this quit function


You have to invoke Looper.myLooper().quit()

0

精彩评论

暂无评论...
验证码 换一张
取 消