39

听说你还在用工具类来判断网络状态?试试这个吧,像使用EventBus一样简单优雅

 4 years ago
source link: https://juejin.im/post/5ce0c238e51d4510595d90cb
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
基操,先举栗子? 在项目中总是会有需要判断网络状态的地方,我们常用的方法就是抽出一个工具类,我顺手就是一个栗子?: //判断网络是否可用 public static boolean isNetworkAvailable() { Connectivi

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK