Switch talk group without reconnecting

This commit is contained in:
ua1zbe
2026-08-17 10:55:44 +03:00
parent 9838daea2f
commit eeffc14f1a

View File

@@ -547,13 +547,13 @@ class MainActivity : Activity(), SvxService.Listener {
getString(if (active) R.string.btn_monitor_on else R.string.btn_monitor) getString(if (active) R.string.btn_monitor_on else R.string.btn_monitor)
} }
/** Переключиться на другую группу: пересохранить и переподключиться. */ /** Переключиться на другую группу: отправить серверу по живому соединению. */
private fun switchGroup(tg: Long) { private fun switchGroup(tg: Long) {
settings = settings.copy(talkGroup = tg) settings = settings.copy(talkGroup = tg)
connectedSettings = settings
Prefs.save(this, settings) Prefs.save(this, settings)
refreshUi() refreshUi()
svc?.disconnect() svc?.selectGroup(tg)
mainHandler.postDelayed({ connect() }, 500)
} }
private fun monitorTgLabel(): String = private fun monitorTgLabel(): String =