# 'AsyncTask<Params!, Progress!, Result!>' is deprecated. Deprecated in Java

**Code:** `AsyncTask deprecated / Handler() deprecated` · **Category:** Android · **Seen on:** Android, Kotlin

AsyncTask is removed from the recommended APIs.

## Meaning

Replace it with coroutines, `Executor` or WorkManager. For Handler use `Handler(Looper.getMainLooper())`.

## Common causes

- Old code using AsyncTask
- Handler() without Looper
- Library needing update

## Quick fix

1. Use Kotlin coroutines
2. Use an Executor/WorkManager
3. Pass `Looper.getMainLooper()` to Handler

## Detailed fix by platform

### Kotlin

1. `lifecycleScope.launch { val r = withContext(Dispatchers.IO) { load() }; show(r) }`

## How to diagnose

1. **Usage** — AsyncTask?
2. **Handler** — Looper passed?
3. **Replacement** — chosen?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/android/deprecated-asynctask-handler)
