for (int i = 0; i < devList.size(); i++) {
RemoteDevice btrd = ((RemoteDevice) devList.elementAt(i));
names[i] = btrd.getFriendlyName(true);
}
TextMenu searchMenu = new TextMenu(names,1);
String[] subItems = {"Connect"};
TextMenu subMenu = new TextMenu(subItems,4);
int selected;
do {
LCD.clear();
LCD.drawString("Found",6,0);
LCD.refresh();
//Menu 1: Show all BT Devices
selected = searchMenu.select();
if (selected >=0){
RemoteDevice btrd = ((RemoteDevice) devList.elementAt(selected));
LCD.clear();
LCD.drawString("Found",6,0);
LCD.drawString(names[selected],0,1);
LCD.drawString(btrd.getBluetoothAddress(), 0, 2);
//Menu 2: Show GPS Device
int subSelection = subMenu.select();
if (subSelection == 0){
GPSDetected = true;
GPSDevice = btrd;
break;
}