pb erreur de pointeur aidez moi please
bonjour a tous,
g un petit prob avec un programme:
je travail en J2ME
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
try
{
// Open RecordStore "FormAceRMS", on instancie un RecordEnumeration sur celui ci
System.out.println(" selected_RMS 2: "+selected_RMS);
RecordStore rs = RecordStore.openRecordStore("Record RMS",true);
RecordEnumeration re = rs.enumerateRecords(null,new FormAlphabetic(),true);
//add 1 tab id and tab FormAceRMS
tab_FormAceRMS = new String[re.numRecords()];
tab_id = new String[re.numRecords()];
for(int a = 0 ; re.hasNextElement();a++)
{
int id = re.nextRecordId();
String InfoCollection = getInfo(id)[2] ;
if ( InfoCollection.equals(selected_RMS) )
{
tab_FormAceRMS[a] = getInfo(id)[crit];
System.out.println(" tab_FormAceRMS[a] "+tab_FormAceRMS[a]);
tab_id[a] = ""+id;
}
}
//Close RecordStore
rs.closeRecordStore();
}
catch(Exception e){}
// drp_type_accueil = new ChoiceGroup("level favorites:", Choice.POPUP,genre_string, null);
drp_type_accueil= new ChoiceGroup("Sort", Choice.POPUP,criter, null);
List_contact = new ChoiceGroup("List:", Choice.EXCLUSIVE,tab_FormAceRMS, null); |
il me met lerreur suivante:
Code:
1 2 3 4 5 6 7 8 9 10 11 12
|
java.lang.NullPointerException
at javax.microedition.lcdui.ChoiceGroup.<init>(+92)
at javax.microedition.lcdui.ChoiceGroup.<init>(+10)
at FormListAce.init(+336)
at FormListAce.ListRMS(+9)
at FormShowCollection.commandAction(+115)
at javax.microedition.lcdui.Display$DisplayAccessor.commandAction(+282)
at javax.microedition.lcdui.Display$DisplayManagerImpl.commandAction(+10)
at com.sun.midp.lcdui.DefaultEventHandler.commandEvent(+68)
at com.sun.midp.lcdui.AutomatedEventHandler.commandEvent(+47)
at com.sun.midp.lcdui.DefaultEventHandler$QueuedEventHandler.run(+250) |
ce que je comprend pas car si jenleve le IF le prog marche tres bien.
le if... sert a me faire une comparaison avec une collection et mafichee que les enregistrement qui corresponde a cette collection
cordialement
mike