Most voted "asynctask" questions
Asynctask is an Abstract Class used to run methods on a background thread, leaving Thread UI (Main Thread) free. The use of Asynctask is for processes of few seconds, in case it is necessary to perform more time-consuming processing, it is advisable to use the options of Apis present in the package "java.util.Concurrent", as indicated in the documentation.
Learn more…79 questions
Sort by count of
-
9
votes1
answer907
viewsThread or Asynctask? When and which one should I use?
When it is recommended to use threads? At what point it is advisable to use the AsyncTask? I would like to know what to use and when to use it.
-
5
votes1
answer197
viewsFire Asynctask class exception
The class below is responsible for obtaining data from a WCF Rest service: public class MyAsyncTaskGeneric<T> extends AsyncTask<String, Void, T>{ private final Class<T>…
-
5
votes4
answers2064
viewsWhat are the main differences between Handler, Thread and Asynctask?
The Android documentation can end up being a little confusing for those who are starting to understand better what are the differences between a Handler, one Thread and a AsyncTask. Handlers sane…
-
4
votes1
answer572
viewsHow to return more than one value using an Asynctask on android?
Briefly, my class that extends an Asynctask, downloads a series of data byte type, then I need to perform some calculations with this data, and finally return all these values to my Mainactivity.…
-
4
votes2
answers837
viewsAndroid Progressdialog does not appear
I am trying to show a Progressdialog in the process of downloading a binary file, however this does not appear, and I get no error either. I will briefly explain the way I have structured code In my…
-
4
votes1
answer1975
viewsCalling an asynchronous function in an Actionresult?
How to make the call of an asynchronous function on a non-asynchronous controller, to be clearer follows a situation: I have a form that when saving it needs to store data in the database and…
-
3
votes1
answer155
viewsAsynctask causes a fatal error while executing the Ackground() method
The code does not present any error, but when I run it stops and presents a Fatal error at runtime in the Asyncloadxmlfeed class extending from Asynctask. follows the class code Asyncloadxmlfeed…
-
3
votes1
answer184
viewsAsynctask Android
I have a "Runnable" method that executes in a new Thread a certain method to update my list. Every time I call this "Runnable", I’m creating a new Thread, which for me is not very positive... How…
-
3
votes1
answer145
viewsIgnored await in asynchronous method c#
I need to use the return of an asynchronous method for validation but even with the use of "await" the method is still running before I receive the return of the function. var teste = await new…
-
3
votes1
answer342
viewsChange Httpparams code to httpurlconnection
I have a code that connects json to a mysql database, but Httpparams is obsolete in the version of java I’m using, so I’d like to know how to do it or how best to put new parameters and maintain…
-
3
votes1
answer1242
viewsDownload async with Webclient.Downloadfileasync
Today I have a class that downloads photos, but as there are many photos always above 5mil think I could take advantage with async method. Process multiple task at the same time. But I think I’m…
-
2
votes1
answer45
viewsDynamic Waitforexit process.
I wonder if there is any way to know if the process came out, even continuing the implementation of the project. When using Processo.WaitForExit it to the application, its execution is stopped. I…
-
2
votes1
answer90
viewsDoes Webservice (Asynctask) only work with Debug?
I’m making my Android app upload data from a Webservice. In it, I will load date data into a Spinner and, when it is complete, the same dates will load other data types into a Listview, but for now…
-
2
votes0
answers120
viewsVery slow Httpurlconnection implementation when running
I’m using the class HttpURLConnection to make the connection to a site that returns a JSON and I did the following encoding: URL url = new URL("http://hmkcode.appspot.com/rest/controller/get.json");…
-
2
votes1
answer495
viewsTask.Run locking inside a "tick" (Forms.Timer)
In my application, I created a "Timer" (System.Windows.Forms) that runs every 1 second. In the "tick" event, I placed a await Task.Run. For some reason the tick stops running after a while (because…
-
2
votes2
answers427
viewsWhat is the sequence of executions for Asynctask?
I need to synchronize data between the server and client application on Android and for this I created several classes ASyncTask, one synchronizes the Third Party, the other the Financial,…
-
2
votes2
answers258
viewsFinish the last Asynctask before starting another
I’m wearing a AsyncTask (Android app) to receive a string json from the server (Comes from a controller on my ASP MVC site). Basically everything that comes from the server goes through this class…
-
2
votes0
answers89
viewsNot doing the replace Fragment
Hello, I have an app that so when it is accessed loads a feed, Initiating an Asynctask, but if the user presses in one of the options of Drawer before the Task ends, the app does not replace and…
-
2
votes1
answer164
viewsAvoid response delay message
I am developing an application that consumes, via REST, a third party service. In some cases the service takes time to answer me and, as the application is waiting for reply, a message appears…
-
2
votes1
answer379
viewsProgress Bar with Asynctask and multiple download links
I have an Asynctask that downloads several images that I pass through an Arraylist with the links to download and I use a Progress bar and it is not working perfectly. The progress bar restarts to…
-
2
votes1
answer49
viewsError using Asynctask more than once
I am developing an application for android that connects to a webservice, to make the connection part I used an Asynctask to avoid crashes, but when I run the application I can register the user…
-
2
votes0
answers39
viewsThreading Problems in Windows Form
I’m trying to implement Threads in my algorithm, however when adding and running my software the Windows Form of it hangs and does not perform any action, can you see anything wrong in the code…
-
1
votes1
answer1100
viewsConsuming JSON webservice with the use of Asynctaks
Well, I’m trying to make an application that logs into a database, previously I was using the thread method to get, this working, but at the time of informing the error messages on the screen, or…
-
1
votes1
answer115
viewsAndroid Volley Multiple Requests in Parallel
I’m developing an application where I have to make several Volley requests in parallel to fill out spinners, and there are two times I call this screen. The first time is for a new registration,…
-
1
votes1
answer76
viewsHelp with Task - Javafx
Good afternoon, I would like your help with Progressbar and Task in javafx. I have a progression that have its value altered. I have the following code: Task task = new Task<Integer>() {…
-
1
votes1
answer44
viewsAsynctask compare 2 jsons
I am trying to make my list view popular with a json, it check the information of another json and return me a link in which I will use to fill photos but everything goes right with you setar link…
-
1
votes1
answer107
viewsAsynctask with one or more methods
I would like to know the advantages and disadvantages of using an extended class of AsyncTask, which contains only one or more methods. Example: I create a AsyncTask for each background processing…
-
1
votes1
answer54
viewsAsynktask does not run doInBackGround
I am developing an android app for the integrative college project in which I need to pass parameter 2 strings (user and password) to a PHP API that will return a User object or a Boolean false. I…
-
1
votes1
answer308
viewsTreat exception in an Asynctask
I use a Asynctask in the app that works blz, however if the Webservice is out of the air, it returns that the application has stopped, I have tried to treat the exception in several ways but it does…
-
1
votes1
answer656
viewsReturn onPostExecute() String
I have this code: Mainactivity: @Override protected void onCreate(Bundle savedInstanceState) { ... btn_login.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {…
-
1
votes0
answers44
viewsProccess Dialog does not open Asynctask
During an API interaction that lasts on average 5 seconds, I need to place a Process Dialog. My code: public class finalizaPedido extends AsyncTask<Object, Void, Integer> { private String…
-
1
votes1
answer80
viewsJson for android Markers
I’m trying to loop markers from google maps, picking up information from a json, but I’m stuck on "transferring" the information from doinbackground to the Google method. To better understand,…
-
1
votes1
answer86
viewsIt takes a long time to get results, even with Asynctask’s in parallel
I send a request to the server but it takes to receive the result, I realized that the Asynctask that sends the location to the server every 1 second is getting in the way. I realized this after I…
-
1
votes1
answer74
viewsProblems with Asynctask
I’m trying to file a request for JSON, along with Asynctask. With this, I called the JSON in the InBackground method, however, the code executes the Jsonarrayrequest onResponse method after the…
-
1
votes1
answer82
viewsTask em await Task.Whenall New transaction is not allowed because there are other threads running in the Session
I’m doing a show Console, where he basically performs these 4 procedures Recovers a IEnumerable<_Url> Make a stop on those urls Inserts to the Database Mark this _Url as read (processed) so it…
-
1
votes1
answer27
viewsWebclientdownloadfiletaskasync file in use, even with Dispose
I am downloading 10 images at the same time async way, However in the 2nd photo usually the error that the image is in use. The process can not access the file because it is being used by Another…
-
1
votes2
answers102
viewsHow to set data correctly in Lisview?
Guys, I’m picking up a bit with asynchronous request on Android. I’m requesting a list of states on JSON, via OkHttp, and turn into a ArrayList states to be able to state ListView. However, in every…
-
1
votes1
answer53
viewsPause an Asynctask until a task is completed
In my Asynctask I urge 4 new objects, only I have to stay in it until all objects are brought in. Follow the code: @Override protected Void doInBackground(Void... voids) { new…
-
1
votes1
answer107
viewsHow do I send data to a socket server that has already been started within an Asynctask?
I was able to connect to the server through the application, receive and show the data sent by it. There is also no problem sending messages to the server. The problem is: once the connection is…
-
1
votes1
answer73
viewsHow to check if there was an error in the POST
I need to check if there was any error in the reply of onPostExecute or gave time out on the server, because sometimes it gives some error in the process and this method does not even start, as I…
-
1
votes1
answer89
viewsHow to return an avinda list of the database using Asynctask, and then deliver it to the class that will manipulate it?
I have an Internet class that loads a list from the database, but on the return of the doInBackground it returns the empty list. I already tested and the for is getting it right, then populates the…
-
1
votes0
answers56
viewsSending and Returning variables from a separate asyncTask in a separate java class
I am developing a program that consists of inserting variables, processing them through an Asynctask in a separate java class called backgroundWorker and returning values, according to the drawing…
-
1
votes0
answers29
viewsSqlite does not input data into the database during an Asynctask
I’m trying to add data to DB inside an Asynctask. In it I catch the Inputstream coming from an httpURLConnection, I interpret the JSON and saved in the local Sqlite. But I don’t even know if this is…
-
1
votes0
answers49
viewsFunction in Mainactivity waiting for an asynchronous return of a function that is in an Asynctask, there being intermediate classes between both
The application has a Class with functions that perform actions in an internal BD and another Class that does almost the same for a BD by an external API. I’ve reviewed the case soen in English and…
-
0
votes1
answer669
viewsAndroid - Listview with image via url, how to add one?
I’ve done several searches on how to add an image to an android listview item, I’m doing everything via JSON and by Asynctask but I’m having a hard time adding this image, someone has an example or…
-
0
votes1
answer263
viewsHow to generate thumbnails of a bitmap using Asynctask?
I have a Fragmentactivity that has a listview, in each item there is a button to open a Dialog, in this Dialog another listview is run with an Adapter that has a Textview and an Imageview, the list…
-
0
votes0
answers199
viewsParallel Return Problem.Foreach
Good evening, everyone! I am making a system in C# Windowsforms for validation of phone bills model FEBRABAN V2. The files usually have between 600Mb to 15Gb, for this reason I opted for the use of…
-
0
votes0
answers75
viewsUse Asynctask to capture web page data in Android app
Good morning, another newcomer in android development. Going straight to the point, I would like to know how to call an Asynctask, which captures a String in a web page, within another class,…
-
0
votes2
answers109
viewsCancel Asynctask when choosing another menu item with Navigation Drawer
The Problem I’m developing an app that has a side navigation menu (Navigation Drawer) as shown below. Loading some items from this menu requires an Internet request. Here at this point everything…
-
0
votes0
answers47
viewsContext error in internal method the class that extends asynctask
Hello, I posted the full code. The compilation error occurs in the playmusic class. Thank you for your attention! public class Agendador { //Toolkit toolkit; Timer timer; public Agendador() { //…