davidortinau/maui-skills/maui-app-lifecycle
Claude Code and agent skill by davidortinau/maui-skills
- community
Checking that the SKILL.md file is still in the repository.
.NET MAUI app lifecycle guidance covering the four app states (not running, running, deactivated, stopped), cross-platform Window lifecycle events, backgrounding and resume behaviour, platform-specific lifecycle mapping for Android and iOS/Mac Catalyst, and state-preservation patterns. USE FOR: "app lifecycle", "OnStart", "OnSleep", "OnResume", "backgrounding", "app state", "window lifecycle", "save state on background", "resume app", "deactivated event", "lifecycle events". DO NOT USE FOR: navigation events (use maui-shell-navigation), dependency injection setup (use maui-dependency-injection), or platform APIs (use maui-platform-invoke).
Install
npx vskill@latest install davidortinau/maui-skills/maui-app-lifecycleSKILL.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.
⚠️ Deactivated ≠ Stopped
A dialog, split-screen, or notification pull-down triggers Deactivated without Stopped. Don't save heavy state on Deactivated — the app may never actually background.
⚠️ Android back button skips Stopped
On Android, pressing the hardware back button may call Destroying without Stopped if the activity finishes. Critical save logic in OnStopped alone can be missed.
⚠️ Multiple windows fire independently
On iPad, Mac Catalyst, and desktop Windows, each Window instance fires its own lifecycle events independently. Don't assume a single global lifecycle.
Performance: Keep Handlers Fast
Long-running work in lifecycle handlers causes ANR kills on Android (5s timeout) and watchdog kills on iOS (limited background time).
For larger state, use SecureStorage or file-based serialization — but keep it under 1–2 seconds.
iOS Scene Lifecycle
iOS 13+ uses the scene lifecycle (SceneWillConnect, etc.). Older delegate methods are still forwarded by MAUI, but you should target scene-based APIs for modern iOS.
State Preservation Checklist
- [ ] Transient UI state (scroll position, draft text) saved in
OnStopped - [ ] State restored in
OnResumed— not inOnActivated(avoid double-restore) - [ ] No heavy I/O in
OnDeactivated— it fires too frequently - [ ] Android: critical save logic also in
OnDestroying(back-button case) - [ ] Lifecycle handlers complete in under 2 seconds
- [ ] Multi-window apps handle per-window state independently
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/maui-skills/skills/maui-app-lifecycle/SKILL.md
Popularity
- Repository stars
- 135
- Repository forks
- 16
- 7-day trend score
- 25
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 10 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/davidortinau/maui-skills/maui-app-lifecycle)