ClashMetaForAndroid
ClashMetaForAndroid copied to clipboard
fix broadcast receiver not registered when application started with no ui, e.g. from settings tile or external control
fixes #421
The broadcast receiver should not be unregistered when the App becomes invisible since it still needs to listen to Intents.ACTION_CLASH_STARTED Intents.ACTION_CLASH_STOPPED to correctly update clashRunning state. However, Broadcasts.registered was never updated to true so the unregister function never acctually took effect.
The problem is that when the App is started without ui, it never became visible, so the Broadcast receiever wasn't registered at all.