File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
app/src/main/java/io/pslab/fragment Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 2525import java .io .InputStream ;
2626import java .io .OutputStream ;
2727import java .util .ArrayList ;
28+ import java .util .List ;
2829import java .util .UUID ;
2930
3031import io .pslab .R ;
@@ -35,16 +36,16 @@ public class BluetoothScanFragment extends DialogFragment {
3536 private ProgressBar scanProgressBar ;
3637 private ListView scannedDevicesListView ;
3738 private ArrayAdapter <String > deviceListAdapter ;
38- private ArrayList <String > deviceList ;
39- private ArrayList <BluetoothDevice > bluetoothDevices ;
39+ private List <String > deviceList ;
40+ private List <BluetoothDevice > bluetoothDevices ;
4041 private final BroadcastReceiver broadcastReceiver = new BroadcastReceiver () {
4142 public void onReceive (Context context , Intent intent ) {
4243 String action = intent .getAction ();
4344 if (BluetoothDevice .ACTION_FOUND .equals (action )) {
4445 BluetoothDevice device = intent .getParcelableExtra (BluetoothDevice .EXTRA_DEVICE );
4546 if (device != null ) {
4647 String deviceName = device .getName ();
47- deviceList .add (deviceName );
48+ deviceList .add (deviceName == null ? device . getAddress () : deviceName );
4849 bluetoothDevices .add (device );
4950 deviceListAdapter .notifyDataSetChanged ();
5051 }
You can’t perform that action at this time.
0 commit comments