AsyncTask Params object parameter

I know how to handle the asynctask but i have some doubt now. Pls check my aysnctask code below public class MyAsynTask extends AsyncTask<Object, Object, Object> { @Override protected Object doInBackground(Object... params) { Log.d("Main params

Running multiple threads in Asynctask

I'm getting info from an URL and sending that info to multiple URLs. I'm running it on a "for" in AsyncTask but the fact is it doesn't continue if other action doesn't return an error or success. So I wanted to do it in an AsyncTask-ception but

JSON parser java.lang.NullPointerException

im getting this error, trying to build a JSON parser with a ListView. I tried this code with another JSON source and it works but with this link crashes: I´d love some help :D E

Add a listener in AsyncTask when called postExecute

I have a AsyncTask class. here is code. private class WaitSec extends AsyncTask<Void, Void, Boolean>{ @Override protected Boolean doInBackground(Void... params) { try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } if

Android: best way to use AsyncTask OnProgressUpdate

I am using AsyncTask to perform some work, I need the progress update but i don't know how to get the progress update here. dowork() can have any task to perform, I need progress update of the work. Thank you for your help! class MyTask extends Async

android.os.NetworkOnMainThreadException but I used AsyncTask

I have a problem with my class who use a http connection. The error is for the connection, i read that error mean that i have to use the AsyncTask, but i used it and my app still doesn't work. Here there is the code: @Override public void onCreate(Bu

How can I change the view at the end of AsyncTask?

I have an AsyncTask that queries the database, then return boolean. I'm trying to set progressbars visibility off on onPostExecute method. I'm getting nullpointerexception: Attempt to invoke virtual method 'void android.widget.ProgressBar.setVisibili

get the current date of the internet in android

I want to know if there is any API/class in android which can give us the original date as I do not want to get the date/time from android device.You can get UTC time from and convert it to your local time format.

How to properly use AsyncTask on Android?

I need help with checking if the phone my app is running on is connected to the Internet. I started with pinging an IP to check connection. It looked like this: protected Boolean checkInternetConnection(Void... params) { try { InetAddress ipAddr = In

The display of the Android image makes the application slow

In my app i have an ImageView. Before adding that ImageView the app was performing smooth. now it throws ANR. The image is saved in the database as base 64 encode string and it is decoded to bitmap and loaded to the imageview using : imageView.setIma

Access the answer json from another activity

I have a fragment and I'm accessing a API inside onCreate() in the fragment, then the I'm getting the json response to the same fragment class (which is returned from the onPostExecute() in AsyncTask class). Now I'm receiving the json response inside

Android AsyncTask re-executes when the activity is open

In my App the user has to login. They open the app on the login page They enter email/password and hit login A LoadingScreenActivity is opened that has a swirly circle and is running an AsyncTask that goes to my database and retrieves all the users i

AsyncTask series is not going for running instantly

My MainActivity has 2 views: TextView and a Button. On button click, I am running an AsyncTask which further creates 10 new AsyncTasks for network operations. Every new task creation is delayed by 1 sec. The code is: public class MainActivity extends

NullPointerException on HttpURLConnection

I am trying to implement the following code: public class CheckSomeStaff extends AsyncTask<String, String, String> { private HttpURLConnection urlc; public boolean hasActiveInternetConnection(Context context) { try { this.doInBackground(); if (urlc.

AsyncTask optimization concerning the internal list

People , I have an async task which downloads some news items using a webservice . Here is the psuedo for that . I have an operation that i perform in an asynctask . It downloads some news from a webservice . AsyncTask { AsyncTask(Context context){}

Asynctask with fragments, Shutting down VM error

I'm trying to use a AsyncTask consulting a parseobject and brings me a picture and text in a list, but when running above shows me the following error: 10-27 16:29:18.335: D/AndroidRuntime(28453): Shutting down VM 10-27 16:29:18.335: W/dalvikvm(28453

Running two asynctask instances in Android

I'm executing two asyntask instances, one of them in onCreate and the other one in onScroll handler. The intention of the app is to download via web-services X amount of information and when the scroll goes to the bottom, keep loading information. Th

How to return the value of the asynchronous task in android

I created an async task to call my server to get data from DB. I need to process the result returned from http server call. From my activity i calling the async task in many places. so i cant use member variable to access the result. is there any way

Error during constant call in Java

I'm trying to parse json in my app: So first I Created constant class for my android app, which has about 6 variables for app.config: (Class: 1) public class Constants{ // url to make request public static String url = ""; // J

Android - transmit data of different types

What I am trying to achieve is as follows - I have a java class which calls a URL (passed to it), which returns JSON, which calls a call back from within the calling activity which processes the data. This allows reusability of the aSyncTask code. In

Is DoInBackground canceled when the dialog box closes?

I have a custom progress dialog within an AsyncTask which acts as a download progress, I want to interrupt doInBackground when my custom cancel button pressed. It seems when the dialog dismisses, doInBackground resumes without any problems! I want to

The progress bar is not rejected

I don't accomplish to dismiss progress bar in my Android App. I declare an object bar object and get a String calling the doInProgress function and pass to it an object called v1. When the async task finishes his task, why progress bar (wichs appears

AsyncTask OnPostExecute Does Not Update TextView

I have an AsyncTask running. I have a TextView that I mimic the message a Toast initially produces. I want to clear the TextView upon success in OnPostExecute but it not doing so. The task complete Toast works fine. How do I set the TextView in the O

How to cancel ProgressDialog after finishing all threads?

I have 30 threads (AsyncTask) executed in the same time. Before execute them, I will show progressdialog. After threads finish execution, I will dismiss progressdialog. Any suggestion on How to dismiss ProgressDialog after finish all threads?If you a

Automatic search as user types

I have an Activity where a user types in an EditText, hits a search button, and the app queries a web service and places the results in a ListView. I'd like to do away with the search button. Obviously I don't want every character the user types to h

Loading external images into a grid (no image)

Can anyone see what Im doing wrong here? I know it is a lot of code but I do not get any errors other then that the images do not turn up inside the imageviews. The imageviews turns up but empty. I guess Im running the asynctask in the wrong place or