Android To Read

1) Activity, Memory Leaks, Long running task

Retained Fragments to handle background tasks.
The difference between static and non-static inner classes is subtle, but is something every Android developer should understand. What’s the bottom line? Avoid using non-static inner classes, anonymous inner classes in an activity if instances of the inner class could outlive the activity’s lifecycle.

Instead, prefer static inner classes and hold a weak reference to the activity inside.




2) Handling Configuration Changes with Fragments

Calling Fragment#setRetainInstance(true) allows us to bypass this destroy-and-recreate cycle, signaling the system to retain the current instance of the fragment when the activity is recreated.

It’s not a good practice to use configChanges to prevent destruction and recreation of activity on configuration change.


To handle configuration changes you can implement function onConfigurationChanged().

When you declare your activity to handle a configuration change, you are responsible for resetting any elements for which you provide alternatives. If you declare your activity to handle the orientation change and have images that should change between landscape and portrait, you must re-assign each resource to each element during onConfigurationChanged().

3) Infinite View Pager

4) Caching – How to use DiskLruCache


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s