Skip to content

Remove use of deprecated AsyncTask #1727

@RHenigan

Description

@RHenigan

Bug Report

As of Android SDK 30 AsyncTask was deprecated. HttpRequestTask and RouterServiceValidator.FindRouterTask extend AsyncTask.

See Here: https://developer.android.com/reference/android/os/AsyncTask

Expected Behavior

The library does not use deprecated classes or methods from the Android API

Observed Behavior

The library uses the deprecated AsyncTask

OS & Version Information
  • Android Version: SDK 30
  • SDL Android Version: 5.1.1
Test Case, Sample Code, and / or Example App

The recommended alternative is to use executors: https://developer.android.com/reference/java/util/concurrent/Executors

ExecutorService executor = Executors.newSingleThreadExecutor();
handler = new Handler(Looper.getMainLooper());
    executor.execute(new Runnable() {
        //Run background code

        handler.post(new Runnable() {
            @Override
                public void run() {
                    //Run UI code
                }
        }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA defect in the library

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions