Top "Android-lifecycle" questions

Questions regarding the events forwarded by the system to components, during their lifetime, in an Android Application.

Register and Unregister the BroadcastReceiver in Application Class

I have a broadcast receiver Which is registered in the onCreate() method of Android Applcation class but How to unRegister …

java android android-lifecycle application-lifecycle
Android: Duplicating of fragments when using Support Fragment Manager

I have a very weird issue with fragments. I use the newest support library. I also use similar code as …

android android-activity lifecycle fragment android-lifecycle
Android lifecycle library: Cannot add the same observer with different lifecycles

I have an app I'm working on that's using the lifecycle library but I'm getting an IllegalArgumentException that says "Cannot …

android android-lifecycle
Measure view in fragment

I need to know ImageView width and height. Is there a way to measure it in fragment ? In standard Activity …

android android-fragments android-lifecycle
Application Level onResume Android

Problem The idea is very simple. Whenever an user comes back to my app from the Recents I want to …

android android-lifecycle resume
RuntimeException:ClassNotFoundException android.arch.lifecycle.ProcessLifecycleOwnerInitializer

I am getting this error only on Android SDK < 5.0. So 4.0, 4.2, 4.3 ect. Anything running Android 5.0+ works flawlessly. Any ideas? Crashes …

android android-support-library android-lifecycle
what is the fragment equivalent of Activity.isFinishing()?

In my activities I frequently use this idiom: @Override public void onDestroy() { super.onDestroy(); if (isFinishing() != true) return; // do some …

android android-activity android-fragments android-lifecycle
Reacting to activity lifecycle in ViewModel

I'm trying to create an app which will use MVVM architecture and there's one thing I quite don't understand. Official …

android mvvm android-lifecycle android-architecture-components
ExoPlayer Restore State when Resumed

I have implemented the Player and now there is a problem. When the video is playing and if the app …

android android-studio android-fragments android-lifecycle exoplayer
Android Chronometer, retain time state (and keep counting in background)

I have a timer that counts up from the time a user encounters that activity I am currently using a …

android android-activity android-service android-lifecycle chronometer