首页 > 解决方案 > 为什么我不能使用 asyncTask

问题描述

旧图书馆

异步任务

Android AsyncTask 已弃用。所以我不能使用这个库。我搜索了其他从 Internet 获取数据的方法,但我做不到。我怎样才能用其他方式写它?

标签: androidandroid-studiomobile

解决方案


是的,这个图书馆很旧。并且 android studio 不再支持这个了。我重做你的项目。您可以从 Internet 上搜索 Volley 或 Retrofit 获取数据。您可以查看我的 github 存储库 -> https://github.com/yagmurerdogan/WeatherApp/blob/master/app/src/main/java/com/tutorials/weatherapp/MainActivity.kt


推荐阅读