Robospice as replacement for Async Tasks

62 Views Asked by At

I am new to android development, I tried understanding the Robospice library which is very much useful for network tasks, But I am trying to use the Robospice as a replacement for Async Task due to their weak binding to Activity lifecycle.

I have created the SpiceService as said in their starter guide: https://github.com/stephanenicolas/robospice/wiki/Starter-Guide#create-a-services.

But I am confused about what to do next. Anyone who can give a small example which is leveraging the Robospice library and replace the Async task and provide good binding to Activity is appreciated.

Thanks in advance.

1

There are 1 best solutions below

0
josh_gom3z On

In your AsyncTask class, the code inside doInBackground() usually should be inserted into the loadfromnetwork method in the SpiceRequest that you created. Ask if you want more clarification.