The Startup
Published in

The Startup

iOS & Android onBackground & onForeground

Picture by Jack Finnigan on Unsplash

Sometimes we want our App to perform some task when it is put to background (e.g. to save some data) or they are brought back to foreground (e.g. to sync some data).

Here I share how they are done on both iOS and Android, to know their similarity and differences.

How to detect onBackground/onForeground




Get smarter at building your thing. Follow to join The Startup’s +8 million monthly readers & +756K followers.

Recommended from Medium

CSS Relative Font Size

Handwritten code betraying you

Taking Ownership and Re-architecting @ Farfetch

Building a Cross-Region Hybrid Cloud Storage Gateway for Machine Learning & AI at WeRide

Application resilience in a digital world, part 3

Which Framework to Choose: Comparing Django vs Ruby on Rails

GraphQL API integration tests in a Spring Boot 2.x Kotlin application

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Sharing Software Development Experience, focus on Mobile.

More from Medium

Setting UserAgent in Android Webview

Listening to your Android App

Getting… rid of those red underline errors on your KMP project (iOS)

How to Handle a Memory Leak in Android