当前位置:   article > 正文

android view stop,在API级别22中不推荐使用android – stopLeScan()和startLeScan() – 如何使用stopScan()和startScan()替...

stoplescan

我看到stopLeScan()&在Android 5.1.1中不推荐使用startLeScan().我有问题替换我的stopLeScan()& startLeScan()方法.这是我的以下代码:

@Override

protected void onListItemClick(ListView l, View v, int position, long id) {

final BluetoothDevice device = mLeDeviceListAdapter.getDevice(position);

if (device == null) return;

final Intent intent = new Intent(this, MainActivity.class);

//intent.putExtra(DeviceControlActivity.EXTRAS_DEVICE_NAME, device.getName());

intent.putExtra(MainActivity.EXTRAS_DEVICE_ADDRESS, device.getAddress());

if (mScanning) {

mBluetoothAdapter.stopScan(mLeScanCallback);

mBluetoothAdapter.getBluetoothLeScanner();

mScanning = false;

}

startActivity(intent);

}

private void scanLeDevice(final boolean enable) {

if (enable) {

// Stops scanning after a pr

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/爱喝兽奶帝天荒/article/detail/945161
推荐阅读
相关标签
  

闽ICP备14008679号