当前位置: 首页>>代码示例>>Java>>正文


Java NetWorkUtil.isWifiConnected方法代码示例

本文整理汇总了Java中com.socks.jiandan.utils.NetWorkUtil.isWifiConnected方法的典型用法代码示例。如果您正苦于以下问题:Java NetWorkUtil.isWifiConnected方法的具体用法?Java NetWorkUtil.isWifiConnected怎么用?Java NetWorkUtil.isWifiConnected使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.socks.jiandan.utils.NetWorkUtil的用法示例。

在下文中一共展示了NetWorkUtil.isWifiConnected方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: onEventMainThread

import com.socks.jiandan.utils.NetWorkUtil; //导入方法依赖的package包/类
public void onEventMainThread(NetWorkEvent event) {

        if (event.getType() == NetWorkEvent.AVAILABLE) {
            if (NetWorkUtil.isWifiConnected(getActivity())) {
                mAdapter.setIsWifi(true);
                if (!isFirstChange && (System.currentTimeMillis() - lastShowTime) > 3000) {
                    ShowToast.Short("已切换为WIFI模式,自动加载GIF图片");
                    lastShowTime = System.currentTimeMillis();
                }
            } else {
                mAdapter.setIsWifi(false);
                if (!isFirstChange && (System.currentTimeMillis() - lastShowTime) > 3000) {
                    ShowToast.Short("已切换为省流量模式,只加载GIF缩略图");
                    lastShowTime = System.currentTimeMillis();
                }
            }
            isFirstChange = false;
        }
    }
 
开发者ID:ZhaoKaiQiang,项目名称:JianDan_OkHttpWithVolley,代码行数:20,代码来源:PictureFragment.java


示例2: PictureAdapter

import com.socks.jiandan.utils.NetWorkUtil; //导入方法依赖的package包/类
public PictureAdapter(Activity activity, LoadResultCallBack loadResultCallBack, LoadFinishCallBack loadFinisCallBack, Picture.PictureType type) {
    mActivity = activity;
    mType = type;
    mLoadFinisCallBack = loadFinisCallBack;
    mLoadResultCallBack = loadResultCallBack;
    pictures = new ArrayList<>();
    isWifiConnected = NetWorkUtil.isWifiConnected(mActivity);
}
 
开发者ID:ZhaoKaiQiang,项目名称:JianDan_OkHttpWithVolley,代码行数:9,代码来源:PictureAdapter.java


示例3: PictureAdapter

import com.socks.jiandan.utils.NetWorkUtil; //导入方法依赖的package包/类
public PictureAdapter(BaseActivity activity, LoadResultCallBack loadResultCallBack, LoadFinishCallBack<Object> loadFinisCallBack, int type) {
    mActivity = activity;
    mType = type;
    mLoadFinisCallBack = loadFinisCallBack;
    mLoadResultCallBack = loadResultCallBack;
    mPictures = new ArrayList<>();
    isWifiConnected = NetWorkUtil.isWifiConnected(mActivity);
}
 
开发者ID:ZhaoKaiQiang,项目名称:JianDanRxJava,代码行数:9,代码来源:PictureAdapter.java


示例4: PictureAdapter

import com.socks.jiandan.utils.NetWorkUtil; //导入方法依赖的package包/类
public PictureAdapter(Activity activity, LoadResultCallBack loadResultCallBack, LoadFinishCallBack loadFinisCallBack, Picture.PictureType type) {
    mActivity = activity;
    mType = type;
    mLoadFinisCallBack = loadFinisCallBack;
    mLoadResultCallBack = loadResultCallBack;
    pictures = new ArrayList<>();
    mRequestHandles = new ArrayList<>();
    isWifiConnected = NetWorkUtil.isWifiConnected(mActivity);
}
 
开发者ID:ZhaoKaiQiang,项目名称:JianDan_AsyncHttpClient,代码行数:10,代码来源:PictureAdapter.java



注:本文中的com.socks.jiandan.utils.NetWorkUtil.isWifiConnected方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。