Skip to content Skip to sidebar Skip to footer

What Is Robospice Library In Android

I am Trying to understand RoboSpice Library in android I saw the online Documentation here What i tried:: I have previously studying on using Spring Library,also Retrofit, Async

Solution 1:

I'm not an expert on RoboSpice but here is my quick explanation of its function:

Often in our app we would like to do Asynchronous network operations (get image from url etc.)

A common technique is to do the network request within an AsyncTask object.

The problem is that the AsyncTask object is not handled by the activity lifecycle.

When the device configuration change occurs (e.g. rotate device) a new activity is created (See Handling runtime changes). The original activity which created the Async network request is destroyed now but the AsyncTask is still working. The AsyncTask which is doing the networking will now maybe try and update the UI with some progress information (e.g. download has completed). But the AsyncTask still refers to the original activity which has been destroyed now. We need the AsyncTask to attach itself to the new activity.

My knowledge is that RoboSpice helps solve this problem. I cannot comment on the underlying implementation of RoboSpice.

Post a Comment for "What Is Robospice Library In Android"