hi friends,

we are using the rms to store records for our midlet. its showing a error(ArrayIndexOutOfBoundsException(1>=1)) when we are trying to retrive string data in our records to a list in Nokia S60 and S80 series. And its Working fine in Nokia S40 series, have you any guys faced such problemes while working with S60 and S80 Series

we are adding the code below , can any on please help us..

thankyou in advance


public String[] retriveContacts()
{
// Vector nameVector=new Vector();
String name[]=new String[50];
int number[]=new int[50];
int i=0;

try
{
try
{
recordStore=RecordStore.openRecordStore("PhoneBook",true);
} catch (RecordStoreException ex)
{
ex.printStackTrace();
}
StringComparator comparator=new StringComparator();
RecordEnumeration recordEnumeration=recordStore.enumerateRecords(null, comparator, true);
try
{
while(recordEnumeration.hasNextElement())
{
int recordId=recordEnumeration.nextRecordId();
ByteArrayInputStream bais = new ByteArrayInputStream(recordStore.getRecord(recordId));
DataInputStream inputStream = new DataInputStream(bais);
try
{
name[i]=inputStream.readUTF();
// nameVector.addElement(name);
number[i]=inputStream.readInt();
}
catch (EOFException eofe)
{
System.out.println(eofe);
eofe.printStackTrace();
}
i++;
}
recordStore.closeRecordStore();
}
catch (RecordStoreException rse) {
System.out.println(rse);
rse.printStackTrace();
}
catch (IOException ioe) {
System.out.println(ioe);
ioe.printStackTrace();
}
} catch (RecordStoreNotOpenException e)
{
System.out.println(e);
e.printStackTrace();
}
return name;
}

public List get_ContactsList() {
if (ContactsList == null) {
// Insert pre-init code here
ContactsList = new List("View Contacts...", Choice.IMPLICIT, new String[0], new Image[0]);
ContactsList.addCommand(get_backCommand3());
ContactsList.setCommandListener(this);
ContactsList.setSelectedFlags(new boolean[0]);
// Insert post-init code here
ContactsList.addCommand(get_runTimeOkCommand());

String name[]=new String[50];
name=salesAutomationDataStore.retriveContacts();

for(int i=0;i<8;i++) {

if(name[i]!=null) {
System.out.println(name[i]);
ContactsList.append(name[i], null);
}
else
{
i=name.length;
}

}
}
return ContactsList;
}