Các đối tượng DeviceClass chứa các lớp của thiết bị của RemoteDevice. (Các đối tượng DeviceClass là giải thích thêm tại mục .) JABWT cung cấp một cách để hủy bỏ một cuộc điều tra. Một ứng dụng có thể muốn hủy bỏ một cuộc điều tra một lần | Programming with the API 199 2000 this .setCurrent splash serviceRecordList Starts the service search. private void startServiceSearch try Search for the Bluetooth Game service record and retrieve the name attribute in addition to the default attributes. UUID uuidList new UUID 1 uuidList 0 new UUID 0FA1A7AC16A211D7854400B0D03D76EC false int attrList new int 1 attrList 0 0x100 The RemoteDevices are in the deviceVector in the same order as they are on the screen so getting the index allows us to retrieve the correct RemoteDevice object. int index RemoteDevice d RemoteDevice index int id attrList uuidList d this catch BluetoothStateException e Alert error new Alert Error Unable to start the service search e. getMessage null 200 Chapter Seven Service Discovery this .setCurrent error deviceList public void inquiryCompleted int type isInInquiry false Alert dialog null Determine if an error occurred. If one did occur display an Alert before allowing the application to exit. if type If the device inquiry was terminated then the user must have selected a RemoteDevice to perform a service search on so start the service search. if type startServiceSearch return else dialog new Alert Bluetooth Error The inquiry failed to complete normally null else dialog new Alert Inquiry Completed The inquiry completed normally null Programming with the API 201 this .setCurrent dialog The startServiceSearch method is called from two different parts of the previous code. The startServiceSearch method is called from the commandAction method if an inquiry is not in progress. If an inquiry is in progress the commandAction method cancels the inquiry and the .