FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Day 6/100: Context in Android — The Wrong One Will Leak Your Entire Activity
How-ToSystems

Day 6/100: Context in Android — The Wrong One Will Leak Your Entire Activity

via Dev.toHoang Son3h ago

This is Day 6 of my 100 Days to Senior Android Engineer series. Each post: what I thought I knew → what I actually learned → interview implications. 🔍 The concept Context is one of those Android classes you use dozens of times per day without thinking about it. You pass it to constructors, use it to inflate views, start activities, access resources. But Context isn't one thing — it's a family of related objects with very different lifetimes. Pass the wrong one into a long-lived object, and you've just anchored that object to a screen that the user may have left minutes ago. The screen can't be garbage collected. You've created a memory leak. Not a theoretical one. A real one that affects every user who navigates back to that screen. 💡 What I thought I knew My rule of thumb used to be: "Use applicationContext when in doubt." That's not wrong exactly — applicationContext won't leak. But it's incomplete, and applying it blindly causes a different class of bugs: UI operations that crash, t

Continue reading on Dev.to

Opens in a new tab

Read Full Article
3 views

Related Articles

Beyond the Code: Why the 7-Step Development Lifecycle is Your Competitive Advantage.‍
How-To

Beyond the Code: Why the 7-Step Development Lifecycle is Your Competitive Advantage.‍

Medium Programming • 4h ago

HadisKu Is Now Ad-Free: Why I Removed Ads From My Islamic App
How-To

HadisKu Is Now Ad-Free: Why I Removed Ads From My Islamic App

Dev.to • 6h ago

How-To

How To Be Productive — its not all about programming :)

Medium Programming • 6h ago

Welcome Thread - v371
How-To

Welcome Thread - v371

Dev.to • 6h ago

Which Software to Develop Apps Is Best in 2026? Top Tools Reviewed
How-To

Which Software to Develop Apps Is Best in 2026? Top Tools Reviewed

Medium Programming • 7h ago

Discover More Articles