- Learning Concurrency in Kotlin
- Miguel Angel Castiblanco Torres
- 84字
- 2021-08-05 10:46:47
NetworkOnMainThreadException
In Java, network operations are blocking by nature. Calling a web service, for example, will block the current thread until a response is received or a timeout/error happens. Because blocking the UI thread would mean freezing all the UI – including animations and any other interactions – Android crashes whenever a network operation is made on the UI thread. The NetworkOnMainThreadException exception will be thrown whenever this happens, forcing developers to use a background thread, and thus improving the user experience.
推薦閱讀
- Mastering Selenium WebDriver
- 青少年軟件編程基礎(chǔ)與實(shí)戰(zhàn)(圖形化編程三級(jí))
- Python Game Programming By Example
- HTML5+CSS3基礎(chǔ)開(kāi)發(fā)教程(第2版)
- Python Geospatial Development(Second Edition)
- Python程序設(shè)計(jì)
- 假如C語(yǔ)言是我發(fā)明的:講給孩子聽(tīng)的大師編程課
- Effective Python Penetration Testing
- JavaScript by Example
- 零基礎(chǔ)學(xué)Python數(shù)據(jù)分析(升級(jí)版)
- 網(wǎng)站構(gòu)建技術(shù)
- Mastering Linux Network Administration
- 青少年信息學(xué)競(jìng)賽
- AutoCAD 2009實(shí)訓(xùn)指導(dǎo)
- Visual C++程序設(shè)計(jì)與項(xiàng)目實(shí)踐