Skip to content

Instantly share code, notes, and snippets.

View AlexanderKrutov's full-sized avatar

Alexander Krutov AlexanderKrutov

View GitHub Profile
@AlexanderKrutov
AlexanderKrutov / BetterAsyncTask.md
Last active April 7, 2017 11:32
Better Implementation of AsyncTask in Android

Better Implementation of AsyncTask in Android

This is a custom wrapper of Android AsyncTask that I use in my projects. It has more convenient fluent API for managing async operations and supports flexible exception handling. You can omit methods that you do not need, like onBefore(...) or onAfter(...). Also you do not need to inherit AsyncTask for each background task.

Example of usage

Background operation with result