I tried with threads, but android throws \"CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.\".
So how can
I know this is a stretch, but here's an answer with coroutines if you happen to use them:
lifecycleScope.launch { delay(3000) header.visibility = View.GONE }