I'll answer this as comprehensively as I can.
Unfortunately you may be displeased (as am I!) to know that this isn't generally possible.
Let's cover network changes first.
- This issue (which is quite old) describes the desire for this feature.
- This PR contains an attempt to implement this in Wallet Adapter.
The problem with this is that Wallet Adapter can only do what wallets can do. Wallets don't generally have a way to either
- Set the network to use for sending things. A few wallets (currently -- Solflare, Glow, Sollet, Blocto) implement this, and their adapters try to support it, but it's uncommon and therefore can't be relied upon.
- Detect when a wallet changes the network it's configured to use. No wallet adapter implements this. If any wallet supports it, it's unknown to me, and because it's uncommon, can't be relied upon.
Now, account changes.
Basically, the same points as above. Wallets don't generally expose APIs for switching active accounts to dapps, and they also don't generally emit events for when active accounts change, or when accounts are added or removed from wallets.
The short answer is that what you want to do cannot currently be done in a general fashion, but it is being actively worked on, by standardizing the interface of wallets and their events, and decoupling the network and account state of wallets from dapps.
I can't provide a timeline of when this will be done, but here's some more reading:
I'll be providing more updates over the next few weeks on the initial draft of a new Wallet Standard that aims to fix these issues and more.