Profile cover photo
Profile photo
Ashesh Bharadwaj
80 followers -
Android and PHP programmer
Android and PHP programmer

80 followers
About
Posts

I read that "Bionic needs to be loaded in each process"? Why can't it be shared among processes?

Is it possible for a LifecycleObserver to observe more than one LifecycleOwner?

Post has attachment
I was wondering how LifecycleOwner receive various lifecycle events avoiding direct implementation in parent classes and then I came across this post http://www.jianshu.com/p/bd800c5dae30

It seems a <provider entry "android.arch.lifecycle.LifecycleRuntimeTrojanProvider" is created in manifest to gain entry and then Application class registerActivityLifecycleCallbacks() method is hooked to Activity lifecycle callbacks.

What seems to be further interesting is in the callback's onActivityCreated() method a headless fragment (ReportFragment) is attached to each activity.

In ReportFragment's overriden lifecycle methods onPause() etc. it's checked whether the Activity is a LifecycleOwner and if so its handleLifecycleEvent() method is called.

Have i understood it correctly?

In the LifecycleObserver class how good is it a practice to hold the reference of Lifecycle object? What complication can arise?

class MyLocationListener implements LifecycleObserver {
private Lifecycle mLifecycle;
public MyLocationListener(Context context, Lifecycle lifecycle, Callback callback) {
mLifecycle = lifecycle
...
}
}

Post has attachment
Lifecycle State

https://developer.android.com/topic/libraries/architecture/lifecycle.html

What is the rationale behind STARTED state when Activity is paused and CREATED state when activity is stopped?
Handling Lifecycles
Handling Lifecycles
developer.android.com

Post has attachment
Wait while more posts are being loaded