Ensure the Activity is available before showing the update notification

dialog.
This commit is contained in:
casey langen 2017-08-10 21:41:23 -07:00
parent 8eab102334
commit 6596701187
2 changed files with 3 additions and 3 deletions

View File

@ -419,7 +419,7 @@ class MainActivity : WebSocketActivityBase() {
private fun runUpdateCheck() {
if (!UpdateAvailableDialog.displayed) {
updateCheck.run { required, version, url ->
if (required) {
if (!isPaused && required) {
val suppressed = prefs.getString(Prefs.Key.UPDATE_DIALOG_SUPPRESSED_VERSION, "")
if (!UpdateAvailableDialog.displayed && suppressed != version) {
val tag = UpdateAvailableDialog.TAG

View File

@ -8,10 +8,11 @@ import android.media.AudioManager
import android.os.Handler
import android.os.IBinder
import android.os.PowerManager
import android.support.v4.app.NotificationCompat
import android.support.v4.media.MediaMetadataCompat
import android.support.v4.media.app.NotificationCompat.MediaStyle
import android.support.v4.media.session.MediaSessionCompat
import android.support.v4.media.session.PlaybackStateCompat
import android.support.v4.app.NotificationCompat
import android.util.Log
import android.view.KeyEvent
import com.bumptech.glide.Glide
@ -27,7 +28,6 @@ import io.casey.musikcube.remote.util.Debouncer
import io.casey.musikcube.remote.util.Strings
import io.casey.musikcube.remote.websocket.Prefs
import android.support.v4.app.NotificationCompat.Action as NotifAction
import android.support.v4.media.app.NotificationCompat.MediaStyle
/**
* a service used to interact with all of the system media-related components -- notifications,