maui-app-lifecycle
Installation
SKILL.md
.NET MAUI App Lifecycle
Critical Behavioral Gotchas
⚠️ Resumed ≠ first launch
Resumed only fires when returning from the Stopped state. On first launch the sequence is Created → Activated — Resumed is never called.
// ❌ Putting initialization logic in OnResumed — won't run on first launch
protected override void OnResumed()
{
LoadUserProfile(); // Skipped on cold start!
}
// ✅ Use OnActivated for logic that must run on every foreground entry
protected override void OnActivated()
{
LoadUserProfile(); // Runs on both first launch and resume
Related skills