Ma io sto sincronizzando sull'oggetto 'roster' ovunque venga new'ed. Come mai ?java.lang.IllegalMonitorStateException: oggetto non bloccato da thread before wait()
Il codice incriminato:
public Roster getRoster() {
if (roster == null) {
return null;
}
if (!roster.rosterInitialized) {
try {
synchronized (roster) {
roster.reload();
long waitTime = SmackConfiguration.getPacketReplyTimeout();
long start = System.currentTimeMillis();
while (!roster.rosterInitialized) {
if (waitTime <= 0) {
break;
}
roster.wait(waitTime);
long now = System.currentTimeMillis();
waitTime -= now - start;
start = now;
}
}
}
catch (InterruptedException ie) {
// Ignore.
}
}
return roster;
}
cosa fa ricaricare()? – Affe
dove chiami notifica – Ronnie