I have two midlet..
the first one (A) contains shared database (abot 400 record, each record 6 fields)
The second midlet (B) is the real application, and use A as database
In B i have a form like agenda, where as soon as i type a char, a list of record is updated.
The problem is this:
- Type 'S' [the list is updating...]
- Type 'P' [the previus list is not ended..so wait...]
- Type 'A' [...wait for end the previus..]
and so on...
This is my code:
SearchFilter search = new SearchFilter(food, 2);
RecordEnumeration re = locationA.enumerate(search, null, false);
String tmp = null;
while (re.hasNextElement()) {
rid = re.nextRecordId();
url = locationA.getURL(rid, true);
// put values in vector RESULT
}
...
...
}
In class SearchFilter:
public boolean matches(byte[] candidate)
{
String str = null;
try
{
strmBytes = new ByteArrayInputStream(candidate);
strmDataType = new DataInputStream(strmBytes);
str = strmDataType.readUTF().toLowerCase();
}
catch (Exception e)
{
return false;
}
// Look for a match
if (str != null && str.startsWith(searchText) ){
return true;
}
else
return false;
}
---------
When i type a new char:
public void itemStateChanged(Item item) {
...
update list, using vector RESULT
...
}
--------
Can anyone help me?
Thanks a lot
Matteo

Reply With Quote

