Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of deprecated AsyncTask #1727

Open
RHenigan opened this issue Aug 25, 2021 · 0 comments
Open

Remove use of deprecated AsyncTask #1727

RHenigan opened this issue Aug 25, 2021 · 0 comments
Labels
bug A defect in the library

Comments

@RHenigan
Copy link
Contributor

RHenigan commented Aug 25, 2021

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
                }
        }
}
@jordynmackool jordynmackool added the bug A defect in the library label Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A defect in the library
Projects
None yet
Development

No branches or pull requests

2 participants