What can I use in core Java as an alternative to Async Task in Android?

I created an application in android. Now I want to create a web version using PlayN. I want to replace all specific Android code with regular Java code. In the Android version, I use the Async task. What can i use instead?

+4
source share
3 answers

Async Task is just a separate thread. You can create your own stream and add the code that you wrote in doInBackground (Void ... params) in the run run run () method.

+3
source

You can download the Android source and copy the AsyncTask source to your project. It has no dependency on Android.

You can find AsyncTask.java here

+1
source

Source: https://habr.com/ru/post/1398221/


All Articles