hussien89aa / AndroidTutorialForBeginners

Step by step to build Android apps using Android Studio
https://www.udemy.com/android-tutorial-for-beginners/?couponCode=ANDORIDGITHUB
4.34k stars 6.1k forks source link

How to check ideal state if application when its in background? #31

Open lmk07 opened 2 years ago

lmk07 commented 2 years ago

hi I'm having the android application. i will be putting the application to background. now i need to check, if the app is active or ideal state. for example : some application may do some operation even though its in background, like playing Audio or Video or downloading.

i want to know how to check it in android studio? thanks
codinguyy commented 1 year ago

Hey, what do you mean by "i need to check, if the app is active or ideal state" and why do you need to check that? When the app goes into the background the onPause() method is called before the app "disappears" from the screen. If you close the app completely the onDestroy() method is called and is in idle state.

In your context the app is in the Pause-State.