本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}