Komischer Fehler bei Android 4:
- Kontakte anklicken
- Kontakt auswählen
- Kontakte nochmals anklicken
- Back Taste
- Crash!
Gekürzte Methode onActivityResult:
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// Get uri of the contact picked by the user
Uri uri = data.getData();
Cursor pCur = managedQuery(uri, null, null, null, null);
while (pCur.moveToNext()) {
// Do something with phones
}
//android 4 bug: android.database.StaleDataException: Attempted to access a cursor after it has been closed.
pCur.close();
}
Lösung:
Den Cursor nicht schließen: //pCur.close();