diff --git a/app/src/main/kotlin/org/akanework/gramophone/logic/GramophonePlaybackService.kt b/app/src/main/kotlin/org/akanework/gramophone/logic/GramophonePlaybackService.kt index 250b409b9..4763c0654 100644 --- a/app/src/main/kotlin/org/akanework/gramophone/logic/GramophonePlaybackService.kt +++ b/app/src/main/kotlin/org/akanework/gramophone/logic/GramophonePlaybackService.kt @@ -94,6 +94,7 @@ import org.akanework.gramophone.logic.utils.LrcUtils.loadAndParseLyricsFile import org.akanework.gramophone.logic.utils.LrcUtils.loadAndParseLyricsFileLegacy import org.akanework.gramophone.logic.utils.MediaStoreUtils import org.akanework.gramophone.logic.utils.SemanticLyrics +import org.akanework.gramophone.logic.utils.convertForLegacy import org.akanework.gramophone.logic.utils.exoplayer.EndedWorkaroundPlayer import org.akanework.gramophone.logic.utils.exoplayer.GramophoneMediaSourceFactory import org.akanework.gramophone.logic.utils.exoplayer.GramophoneRenderFactory @@ -795,8 +796,8 @@ class GramophonePlaybackService : MediaLibraryService(), MediaSessionService.Lis fun updateLyrics(parsedLyrics: MutableList?, parsedLyricsa: SemanticLyrics?) { if ( parsedLyrics.toString() == "null" ){ - lyricsLegacy = SemanticLyrics.convertForLegacy(parsedLyricsa) - adapter?.updateLyrics(lyricsLegacy) + lyrics = parsedLyricsa + adapter?.updateLyrics(lyrics.convertForLegacy()) newView?.updateLyrics(null) } else { lyricsLegacy = parsedLyrics diff --git a/app/src/main/kotlin/org/akanework/gramophone/ui/fragments/settings/ExperimentalSettingsTopFragment.kt b/app/src/main/kotlin/org/akanework/gramophone/ui/fragments/settings/ExperimentalSettingsTopFragment.kt index 574983807..bb4312181 100644 --- a/app/src/main/kotlin/org/akanework/gramophone/ui/fragments/settings/ExperimentalSettingsTopFragment.kt +++ b/app/src/main/kotlin/org/akanework/gramophone/ui/fragments/settings/ExperimentalSettingsTopFragment.kt @@ -82,6 +82,11 @@ class ExperimentalSettingsTopFragment : BasePreferenceFragment() { private fun checkAndRequestNotificationPermission() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) { + if (!isAdded) { + // Fragment 未附着,推迟操作或记录日志 + Log.e("Fragment", "Fragment not attached to context yet") + return + } when { ActivityCompat.checkSelfPermission( requireContext(),