mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-22 21:19:31 +01:00
Fix a cursor crash
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
91ec476f9a
commit
93643269a8
@ -80,6 +80,8 @@ public class RingtoneSelectionController extends BaseController implements Flexi
|
||||
private MediaPlayer mediaPlayer;
|
||||
private Handler cancelMediaPlayerHandler;
|
||||
|
||||
private Cursor cursor;
|
||||
|
||||
public RingtoneSelectionController(Bundle args) {
|
||||
super(args);
|
||||
setHasOptionsMenu(true);
|
||||
@ -180,7 +182,7 @@ public class RingtoneSelectionController extends BaseController implements Flexi
|
||||
manager.setType(RingtoneManager.TYPE_NOTIFICATION);
|
||||
}
|
||||
|
||||
Cursor cursor = manager.getCursor();
|
||||
cursor = manager.getCursor();
|
||||
|
||||
NotificationSoundItem notificationSoundItem;
|
||||
|
||||
@ -212,8 +214,6 @@ public class RingtoneSelectionController extends BaseController implements Flexi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
adapter.updateDataSet(abstractFlexibleItemList, true);
|
||||
@ -299,6 +299,9 @@ public class RingtoneSelectionController extends BaseController implements Flexi
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
endMediaPlayer();
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
super.onDestroy();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user