Skip to content

Commit

Permalink
Fixed: Input dispatching timed out error while creating the applica…
Browse files Browse the repository at this point in the history
…tion shortcuts.

* Moved shortcut creation to `lifecycleScope` with `Dispatchers.IO` to free up the main thread.
* This ensures the UI remains responsive while shortcuts are being created.
  • Loading branch information
MohitMaliDeveloper authored and kelson42 committed Feb 7, 2025
1 parent 549bb5a commit 7474d7e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import androidx.drawerlayout.widget.DrawerLayout.LOCK_MODE_LOCKED_CLOSED
import androidx.drawerlayout.widget.DrawerLayout.LOCK_MODE_UNLOCKED
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentContainerView
import androidx.lifecycle.lifecycleScope
import androidx.navigation.NavController
import androidx.navigation.NavDestination
import androidx.navigation.NavDirections
Expand Down Expand Up @@ -136,7 +137,9 @@ abstract class CoreMainActivity : BaseActivity(), WebViewProvider {
CoroutineScope(Dispatchers.IO).launch {
objectBoxToRoomMigrator.migrateObjectBoxDataToRoom()
}
createApplicationShortcuts()
lifecycleScope.launch(Dispatchers.IO) {
createApplicationShortcuts()
}
handleBackPressed()
}

Expand Down

0 comments on commit 7474d7e

Please sign in to comment.