Java 类android.bluetooth.BluetoothAdapter.LeScanCallback 实例源码

项目:bleTester    文件:MainActivity.java   
@SuppressLint("NewApi")
private void getScanResualt() {
    mLeScanCallback = new LeScanCallback() {
        @Override
        public void onLeScan(final BluetoothDevice device, final int rssi,
                final byte[] scanRecord) {
            MainActivity.this.runOnUiThread(new Runnable() {
                public void run() {
                    mBleDeviceListAdapter.addDevice(device, rssi,
                            Utils.bytesToHex(scanRecord));
                    mBleDeviceListAdapter.notifyDataSetChanged();
                    invalidateOptionsMenu();
                }
            });
        }
    };
}