/**    * Simple network connection check.    *    * @param context    */    private void checkConnection(Context context) {        final ConnectivityManager cm =                (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);        final NetworkInfo networkInfo = cm.getActiveNetworkInfo();        if (networkInfo == null || !networkInfo.isConnectedOrConnecting()) {            Toast.makeText(context, R.string.no_network_connection_toast, Toast.LENGTH_LONG).show();            Log.e(TAG, "checkConnection - no connection found");        }    }

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. android sqlite db-journal文件产生原因
  2. 让Android adb运行在ARM平台上
  3. listView及ScrollView等PadingTop显示问
  4. Android持续集成
  5. android 将SharedPreferences做成简单工
  6. Android 8.0以上获取设备序列号解决方案
  7. 解决overlaps the location of another p
  8. Android(安卓)API翻译:Contact的子类介绍
  9. 完美解决RecyclerView滑动边缘阴影效果
  10. Android锁屏API-DevicePolicyManager介绍