File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
AnkiDroid/src/main/java/com/ichi2/anki Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -472,14 +472,16 @@ class SharedDecksDownloadFragment : Fragment(R.layout.fragment_shared_decks_down
472472 * If there are any pending downloads, continue with them.
473473 * Else, set mIsPreviousDownloadOngoing as false and unregister mOnComplete broadcast receiver.
474474 */
475- @Suppress(" deprecation" ) // onBackPressed
476- private fun checkDownloadStatusAndUnregisterReceiver (isSuccessful : Boolean , isInvalidDeckFile : Boolean = false) {
475+ private fun checkDownloadStatusAndUnregisterReceiver (
476+ isSuccessful : Boolean ,
477+ isInvalidDeckFile : Boolean = false,
478+ ) {
477479 if (isVisible && ! isSuccessful) {
478480 if (isInvalidDeckFile) {
479481 Timber .i(" File is not a valid deck, hence return from the download screen" )
480482 context?.let { showThemedToast(it, R .string.import_log_no_apkg, false ) }
481483 // Go back if file is not a deck and cannot be imported
482- activity?.onBackPressed()
484+ activity?.onBackPressedDispatcher?. onBackPressed()
483485 } else {
484486 Timber .i(" Download failed, update UI and provide option to retry" )
485487 context?.let { showThemedToast(it, R .string.something_wrong, false ) }
You can’t perform that action at this time.
0 commit comments