Questions tagged as 'asynctask'

1
answer

Problems with AsyncTask

I'm trying to make a request for JSON along with AsyncTask. With this, I made the JSON call in the InBackground method, however, the code executes the onResponse method of the JsonArrayRequest after calling the onPostExecute, not at the time of...
asked by 16.09.2016 / 19:17
1
answer

Return String from onPostExecute ()

I have this code: MainActivity: @Override protected void onCreate(Bundle savedInstanceState) { ... btn_login.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { final Stri...
asked by 18.03.2016 / 17:58
1
answer

Error using AsyncTask more than once

I'm developing an application for android that connects to a webservice, to do the connection part I used an AsyncTask to avoid crashes, but when I run the application I can register the user only once, after that I try to register again it retu...
asked by 26.04.2018 / 03:40
2
answers

How to set data correctly in Lisview?

Well, I'm getting a lot of asynchronous request on Android. I am requesting a list of states in JSON , via OkHttp , and transforming into ArrayList states to be able to set states in ListView . However, in all the ways I...
asked by 18.10.2016 / 03:01
1
answer

Consuming JSON webservice with the use of AsyncTaks [duplicate]

Well, I'm trying to make an application that logs into a database, I was previously using the thread method to get it working, but at the time of reporting the error messages on the screen or something, it was not. I have modified it to use as...
asked by 25.05.2015 / 14:40
1
answer

How to check for POST error

I need to check if there was an error in the response from onPostExecute or it gave time out on the server, because sometimes it gives some error in the process and this method does not even start, how could I do such verification? I call it t...
asked by 04.02.2018 / 15:18
1
answer

It takes a long time to receive results, even with AsyncTask's in parallel

I send a request to the server but it takes a long time to receive the result, I noticed that the AsyncTask that sends the location to the server every 1 second is in the way. I noticed this after I changed it to 3 seconds, where I sent a n...
asked by 13.08.2016 / 23:42
1
answer

Json for Markers android

I'm trying to loop markers from google maps, grabbing information from a json, but I'm stopped at "downloading" information from doinbackground to google's google method. To understand better, follow my code: public class MapsActivity extends...
asked by 22.07.2016 / 01:53
1
answer

Handle Exception in an AsyncTask

I use an AsyncTask in the app that works blz, but if the WebService is off the air, it returns that the application stopped, I already tried to handle the exception in several ways but it does not work, as below the Asynctask code working:...
asked by 11.12.2015 / 15:31
1
answer

Task.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 put a await Task.Run. For some reason the tick stops running after a while (because it does not print the date and time on the cons...
asked by 01.09.2015 / 21:55