async await 要点
1.await 后面可以追加promise对象 获取resolve的值
2.await 必须包裹在async函数里面
3.async 函数执行返回的也是一个promise对象
4.try-catch 截获promise中reject的值
async await要点
推荐阅读
- 分享一个Snackbar工具类 SnackbarUtils;
- Android View转为图片保存为本地文件,异步监听回调操作结果;
- Android View添加删除或隐藏显示的默认动画;
- No static field xxxx of type I in class Lcom/xxx/xxx/R$id;
- Android Notification通知栏的使用,通知栏在Android8.0系统不显示的问题;
- @SuppressLint("HandlerLeak"),或Handler使用有警告;
- Android CoordinatorLayout实现多列表切换并和头布局联动;
- ScrollView滑动到底部或顶部监听,ScrollView滑动到底部或顶部再继续滑动监听;
- Android更多状态的布局Layout,可随意切换状态的Layout,加载中、加载失败、空布局...
- RecyclerView中设置match_parent无效;