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


Java WifiConfigManager类代码示例

本文整理汇总了Java中com.google.zxing.client.android.wifi.WifiConfigManager的典型用法代码示例。如果您正苦于以下问题:Java WifiConfigManager类的具体用法?Java WifiConfigManager怎么用?Java WifiConfigManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


WifiConfigManager类属于com.google.zxing.client.android.wifi包,在下文中一共展示了WifiConfigManager类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: handleButtonPress

import com.google.zxing.client.android.wifi.WifiConfigManager; //导入依赖的package包/类
@Override
public void handleButtonPress(int index) {
  if (index == 0) {
    WifiParsedResult wifiResult = (WifiParsedResult) getResult();
    WifiManager wifiManager = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE);
    if (wifiManager == null) {
      Log.w(TAG, "No WifiManager available from device");
      return;
    }
    final Activity activity = getActivity();
    activity.runOnUiThread(new Runnable() {
      @Override
      public void run() {
        Toast.makeText(activity.getApplicationContext(), R.string.wifi_changing_network, Toast.LENGTH_SHORT).show();
      }
    });
    new WifiConfigManager(wifiManager).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, wifiResult);
    parent.restartPreviewAfterDelay(0L);
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:21,代码来源:WifiResultHandler.java

示例2: handleButtonPress

import com.google.zxing.client.android.wifi.WifiConfigManager; //导入依赖的package包/类
@Override
public void handleButtonPress(int index) {
    if (index == 0) {
        WifiParsedResult wifiResult = (WifiParsedResult) getResult();
        WifiManager wifiManager = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE);
        final Activity activity = getActivity();
        activity.runOnUiThread(new Runnable() {
            @Override
            public void run() {
                Toast.makeText(activity.getApplicationContext(), R.string.wifi_changing_network, Toast.LENGTH_SHORT).show();
            }
        });
        taskExec.execute(new WifiConfigManager(wifiManager), wifiResult);
        parent.restartPreviewAfterDelay(0L);
    }
}
 
开发者ID:yakovenkodenis,项目名称:Discounty,代码行数:17,代码来源:WifiResultHandler.java

示例3: handleButtonPress

import com.google.zxing.client.android.wifi.WifiConfigManager; //导入依赖的package包/类
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	@Override
	public void handleButtonPress(int index) {
		if (index == 0) {
			WifiParsedResult wifiResult = (WifiParsedResult) getResult();
			WifiManager wifiManager = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE);
			if (wifiManager == null) {
				Log.w(TAG, "No WifiManager available from device");
				return;
			}
			final Activity activity = getActivity();
			activity.runOnUiThread(new Runnable() {
				@Override
				public void run() {
					Toast.makeText(activity.getApplicationContext(), R.string.wifi_changing_network, Toast.LENGTH_SHORT)
							.show();
				}
			});

//			new WifiConfigManager(wifiManager).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, wifiResult);
			/**
			 * @author MichaelX(xiong_it)modified.{@link https://github.com/xiong-it}
			 * 
			 * {@link http://stackoverflow.com/questions/12227682/android-2-3-3-asynctask-call-throws-nosuchfielderror}
			 * THREAD_POOL_EXECUTOR were added in API Level 11
			 */
			AsyncTask task = new WifiConfigManager(wifiManager);
			if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
				task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, wifiResult);
			} else {
				task.execute(wifiResult);
			}
			parent.restartPreviewAfterDelay(0L);
		}
	}
 
开发者ID:xiong-it,项目名称:PortraitZXing,代码行数:36,代码来源:WifiResultHandler.java

示例4: handleButtonPress

import com.google.zxing.client.android.wifi.WifiConfigManager; //导入依赖的package包/类
@Override
public void handleButtonPress(int index) {
  if (index == 0) {
    WifiParsedResult wifiResult = (WifiParsedResult) getResult();
    WifiManager wifiManager = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE);
    Toast.makeText(getActivity(), fakeR.getId("string", "wifi_changing_network"), Toast.LENGTH_LONG).show();
    taskExec.execute(new WifiConfigManager(wifiManager), wifiResult);
    parent.restartPreviewAfterDelay(0L);
  }
}
 
开发者ID:atomsheep,项目名称:sres-app,代码行数:11,代码来源:WifiResultHandler.java

示例5: handleButtonPress

import com.google.zxing.client.android.wifi.WifiConfigManager; //导入依赖的package包/类
@Override
public void handleButtonPress(int index) {
    if (index == 0) {
        WifiParsedResult wifiResult = (WifiParsedResult) getResult();
        WifiManager wifiManager = (WifiManager) getActivity().getSystemService(Context.WIFI_SERVICE);
        Toast.makeText(getActivity(), R.string.wifi_changing_network, Toast.LENGTH_LONG).show();
        taskExec.execute(new WifiConfigManager(wifiManager), wifiResult);
        parent.restartPreviewAfterDelay(0L);
    }
}
 
开发者ID:thomas-bornschlegel,项目名称:AndroidMultiChannelMiddleware,代码行数:11,代码来源:WifiResultHandler.java


注:本文中的com.google.zxing.client.android.wifi.WifiConfigManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。