Array Index Out of bound exception
in my application i;m trying to send file from my pc to detected bluetooth devices. after detecting the devices , i'm storing each device's info into vector and depending upon size of vector i'm writing the following code
for(int i = 0; i <vecDevices.size();i++)
DataElement serviceNameElement = servRecord[i].getAttributeValue(0x0100); //line 258
String _serviceName = (String)serviceNameElement.getValue();
String serviceName = _serviceName.trim();
if(serviceName.equals("OBEX Object Push"))
System.out.println("[client:] A matching service has been found\n");
connectionURL = servRecord[i].getConnectionURL(0,false);
catch (Exception e)
}//for loop end
but it is throwing arrayindexoutofbound exception at line 258.
could anybody help me? what is the reason for this ..
i've checked out the application using two bluetooth enabled phones ..
it is printing size of vector as 2.. but throwing the same exception