mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-22 21:15:30 +03:00
Fix another crash with ringtone
Signed-off-by: Mario Danic <mario@lovelyhq.com>
This commit is contained in:
parent
9f15661273
commit
a70d36bb80
1 changed files with 6 additions and 2 deletions
|
@ -229,7 +229,6 @@ public class RingtoneSelectionController extends BaseController implements Flexi
|
|||
NotificationSoundItem notificationSoundItem = (NotificationSoundItem) adapter.getItem(position);
|
||||
|
||||
Uri ringtoneUri = null;
|
||||
Runnable runnable = () -> endMediaPlayer();
|
||||
|
||||
if (!TextUtils.isEmpty(notificationSoundItem.getNotificationSoundUri())) {
|
||||
ringtoneUri = Uri.parse(notificationSoundItem.getNotificationSoundUri());
|
||||
|
@ -238,7 +237,12 @@ public class RingtoneSelectionController extends BaseController implements Flexi
|
|||
mediaPlayer = MediaPlayer.create(getActivity(), ringtoneUri);
|
||||
|
||||
cancelMediaPlayerHandler = new Handler();
|
||||
cancelMediaPlayerHandler.postDelayed(runnable, mediaPlayer.getDuration() + 25);
|
||||
cancelMediaPlayerHandler.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
endMediaPlayer();
|
||||
}
|
||||
}, mediaPlayer.getDuration() + 25);
|
||||
mediaPlayer.start();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue