Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander Krutov AlexanderKrutov

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

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