Questions tagged [android-asynctask]

Use for questions on android.os.AsyncTask

Filter by
Sorted by
Tagged with
0 votes
0 answers
25 views

onPostExcute executed before doInbackground in asynctask

i have asynctask which i call api inside doInBackGround and i'm using okhtpp and then i enqueue the request actually the enqueue does not block the main thread so the asyncTask execute onPostExcute() ...
Awos Al-Radaideh's user avatar
0 votes
1 answer
20 views

Why is my JSON Volley request causing ANR if it is Asynchronous in itself and the data transfer into my database is handled within an AsyncTask?(JAVA)

Just an FYI, this is my first time working with JSON, Volley, or ASyncTask. For a coding challenge I have to download a JSON array from a url into an android application and display the list of items ...
jwy205's user avatar
  • 3
0 votes
0 answers
13 views

Uninstalled BumbleBee, installed Flamingo, but now encountering Gradle daemon spawning issue in Android Studio - how to fix?

I have this problem in Android studio after unistalling Bumblebee and installing Flamingo. Multiple Gradle daemons might be spawned because the Gradle JDK and JAVA_HOME locations are different. ...
Earnest O. Wasonga's user avatar
0 votes
1 answer
33 views

AndroidRuntime: FATAL EXCEPTION: AsyncTask #2

I am making an app for showing nearby places. But I have a runtime error FATAL EXCEPTION: AsyncTask #2NullPointerException and the app is crashed. I am trying to send nearby places data URL. But I ...
Yash Deshmukh's user avatar
0 votes
0 answers
13 views

android Replace callbacks with observables from RxJava2

37 Im using callback to observe asynchronous operations with Android, but I think that could be great replacing this listeners with RxJava, I also need retry 3 times when the callback call onError. ...
user1320969's user avatar
0 votes
0 answers
20 views

How to retrieve and send phone contacts data to server using REST API

I would like to know how to retrieve name and phone only information of a phone contacts data and send it to server using async task MySQL Database columns will look like name | phoneNumber ...
adika's user avatar
  • 1
-1 votes
1 answer
36 views

Hi; how can i interrupt an async function during its allotted runtime?

We are coding behaviors for a robot in python async; we would like the robot to have multiple states, within each of which it will exhibit multiple behaviors, some random, some in order. These ...
wibl's user avatar
  • 1
0 votes
0 answers
13 views

get String Array from onpostExecute

I first want to pass the array res to another class. for this I created a get method. Unfortunately the array outside of onPostExecute is empty and I get an error. The call of the data is also delayed,...
chris199's user avatar
0 votes
1 answer
70 views

Android inter thread communication best practices with ViewModel and CameraX?

I have the following scenario (view code below): Get an ImageProxy from the loop of the ImageAnalyzer use case of CameraX Analyze the image (takes about 20 ms) and return some information, close() ...
mo5ch's user avatar
  • 138
1 vote
0 answers
37 views

Android AsyncTasks Not Running in Google Play Deployment but working normal when launched to device from Android Studio

I have been developing Android for 13 years and today I discovered the first issue I am completely not able to understand or even begin to debug. My app which makes a number of web calls to fetch data ...
Edmund Rojas's user avatar
  • 6,336
0 votes
2 answers
36 views

How to make asynchronous tasks and return value only when value is available? (the response is not empty)?

I have a function which returns a List of Strings. This function requesting a response from the server. But firstly the function returns null, then a bit later returns a response with String. How to ...
Dmitry Sergienko's user avatar
0 votes
0 answers
25 views

What is the order between AsyncTask and normal code?

I added AsyncTask class file to receive Json file from API server. At that moment, I has wondered about sequence between code of calling AsyncTask and normal code at under the code. I has known that ...
holyCrap's user avatar
1 vote
0 answers
24 views

Convert AsyncTask to RxJava in Android studio java

First, I'm brand new to java on android studio, and trying to use codes from github using asyncTask. However AsyncTask is deprecated so it needs to be replaced with rxJava according to what I was ...
W 3's user avatar
  • 19
0 votes
0 answers
11 views

When internet turns off and user tries to send the mail, app crashes. Need to prevent the crash

I have implemented the mail sending function in Asynctask. When internet is available and user tries to send the mail, the mail is being sent soomthly. But if internet turns off and user tries to send ...
thebitanpaul's user avatar
0 votes
1 answer
47 views

App is crashing after mail sent successfully using Asynctask

Mail is successfully sending without Asynctask. But I need to show a progress dialog while sending the mail, so I implemented Asynctask to send the mail and while sending show the progress dialog. But ...
thebitanpaul's user avatar
1 vote
1 answer
50 views

For loop inside a class that extends the AsyncTask<Void,Void,Void> doesn't work

In my project, I am trying to scraped data. I have prepopulated sqlite database in my asset folder. The adapter class MySqliteAdapter.java fetch the sqlite database which contains a list of artitle ...
Isaac Darlong's user avatar
0 votes
1 answer
44 views

How can I convert an AsyncTask to a Runnable?

I want to set bitmap for ImageView. I have the URL from Firebase stroage, I use the BitmapFactory to turn to picture, I need to apply it on ImageView, I can do it with AsyncTask but I don't know how ...
Jeff Li's user avatar
0 votes
1 answer
77 views

How I can parse JSON data only once when my application is running

I've no idea on how to parse JSON data only once when my application is running. Currently JSON parsing is done on every user interaction like landscape/portrait orientations, page refreshing and page ...
Shakthi's user avatar
  • 15
0 votes
1 answer
24 views

How do I get the Value out of my Class into my TextViewField

At the moment I am trying to make an Android App with Android Studio with GET and POST data into/from an API. My problem at the moment is that I want to have the response of the POST request displayed ...
Justin's user avatar
  • 1
0 votes
1 answer
42 views

How to use AsyncHttpClient inside a public method which returns a string value

I am using 'com.koushikdutta.async:androidasync:3.1.0' in my android application. my cod is like below: import android.app.Activity; import android.content.Context; import android.graphics.Color; ...
Mehran Baki's user avatar
0 votes
1 answer
35 views

Xamarin Android dialog.PositiveButtonClicked not working

I would like to have some code run (use Intent to go to new Activity) when the user clicks the Ok button in a dialog (DialogFragment) I see in the debugger it hits the line of code for .Show. But it ...
angleUr's user avatar
  • 439
0 votes
0 answers
17 views

How do I read files and perform calculations in the background before the activity starts?

I have 2 activities, A and B, B has a recyclerview and it reads files from the external storage and shows the meta data along with some validation of the files. This takes a while so the activity ...
Jim Ross's user avatar
0 votes
0 answers
18 views

async function firebase notify variable onCodeSent

Hey I try to save the verification id outside from is function oncodesent in my code ,the problem is that variable is always null except from the binding of the function this is my code Registration....
N MZ's user avatar
  • 121
0 votes
1 answer
184 views

Async Task Replacement [duplicate]

What is the replacement of async task as it is deprecated and how to use the replacement ? any suggestions. Replacement that functions same as async task.
HarmanPreet Singh's user avatar
1 vote
1 answer
279 views

How can I resolve Task is not yet complete exception when implementing Google Cast into project?

I've been working on this for weeks no joke but I'm really stumped at this one part. So I'm in the process of implementing Google Cast into a poorly constructed codebase that I inherited. Specifically,...
CDK's user avatar
  • 11
0 votes
2 answers
48 views

How to use AsynsTask in JAVA (Android Studio)

I have the following code: int my_couter = 0; if (SDK_INT >= Build.VERSION_CODES.R && Environment.isExternalStorageManager()) { my_couter += 1; } if (ContextCompat....
MTG MODS's user avatar
0 votes
2 answers
80 views

AsyncTask does not updating my textview in resume fragment after destroy

I am running a thread in background contains timer and I display this timer in TextView but when I change current fragment and I return the timer still running in logcat but does not update in UI My ...
No zha's user avatar
  • 45
0 votes
1 answer
26 views

SQL Server and Async class error android.os.NetworkOnMainThreadException

I'm developing an app with Android Studio, java. I perform some operations that require an Async class. After I started using such classes, other activities are no longer able to connect to Sql Server,...
PPavesi's user avatar
  • 43
0 votes
0 answers
35 views

JNI is destroyed the first time it is instantiated

I have a project that I run in a T2 terminal, when I restart and/or shut down the T2 terminal and install the project for the first time, it crashes, but it only happens once, then everything works ...
Jonathan Ramirez's user avatar
0 votes
1 answer
11 views

Asynctask does not return string, but does not contain a reported error

I'm passing a URL to an ASYNC class (wsbRedirTest) and I expect to receive the content of the page. However, it does not return any results. public class wsbRedirTest extends AsyncTask<String, Void,...
PPavesi's user avatar
  • 43
0 votes
0 answers
187 views

ANR input dispatching timed out inside Android Studio

I'm trying to make an app but when I run it some times get slow, or even freezes... the Log cat show me the message "ANR Input dispatching timed out" but I don't know what's wrong, I've ...
Luis Cruz Jiménez's user avatar
0 votes
0 answers
23 views

Multiple retrofit freeze ui

I use multiple retrofit in a service and my ui freeze, So I try with asyncTask executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR); I try also with a Thread but I have the same problem. I put only one ...
Réda Youssoufi's user avatar
0 votes
0 answers
16 views

Deprecated network check method [duplicate]

I have this class to check internet connection inside my app but i don't know how to upgrade it to the lastest version class InternetCheck(private val mConsumer: Consumer) : AsyncTask<Void?, Void?,...
sheko's user avatar
  • 506
0 votes
1 answer
102 views

How can I change AsyncTask (deperecated) to Coroutines in kotlin?

I am migrating code from AsyncTask to Coroutines because AsyncTask is deprecated. How can I implement the change from AsyncTask to Coroutines in the BookRepository.kt. How can I restructure the code? ...
Kaleab Woldemariam's user avatar
1 vote
1 answer
33 views

Using Android futures to move heavy computation to background thread

I have a function that runs on the Android main thread (UI thread): fun someFunc() { ... doSomething1() doSomething2() doSomething3() ... } doSomething2 is a heavy computation that causes ...
AbhinavChoudhury's user avatar
0 votes
0 answers
43 views

My app keeps crashing on when I'm using AsyncTask

I'm developing an app which downloads any image or pdf file in internal storage using a url. For this I'm using the AsyncTask class. The problem occurs as soon as I click the download button. My app ...
M. Hayyan Ali's user avatar
0 votes
3 answers
2k views

Parameter specified as non-null is null : kotlin.jvm.internal.Intrinsics.checkNotNullParameter

I'm trying to upload image to website, It was successful but app shows FETAL error. issue seems like in AsyncTask as it might get executed to early. I also upgraded SDK version 30 to 32 & ucrop:2....
Sandeep Kumar's user avatar
0 votes
0 answers
46 views

fetch the data from firebase and populate the recyclerview through for loop if the keys of the node are stored locally [duplicate]

I have the list of items in one node and in another node, I want to store the key of items that user like. Now through callBack I got all the keys stored in the favorite node and I am trying to search ...
GajjarSVNIT's user avatar
0 votes
0 answers
40 views

Show animation while doing background task in Android

I need to run an animation while doing a background task in an activity. Previously, I used AsyncTask API to show the animation while doing any background task. Currently, the AsyncTask API is ...
Christopher Marlowe's user avatar
0 votes
0 answers
23 views

Is the AsyncTask most productive technique for slow background tasks?

There are few techniques to execute slow code that returns some data in Android. By slow code I mean network, file, database access etc. Thread and Runnable can be used, but I found that getting ...
Kamil's user avatar
  • 13.2k
0 votes
0 answers
242 views

Foreground Service and Progress

Hi Im new in coding and I need some help. Im trying to create a foreground download service with a progress notification. And I made a foreground service after run the app it worked really good, then ...
Meiyo Kun's user avatar
3 votes
2 answers
421 views

Does Kotlin Coroutines replace AsyncTask?

Is AsyncTask still needed? In Android with Java, we used to implement an AsyncTask and AsyncTaskLoader, but recently I've been beginning to learn Kotlin and I've noticed that things like that are done ...
دعاء مصطفى's user avatar
0 votes
0 answers
56 views

How to auto connect to server?

I make a android application connect to server by using "com.mysql.jdbc.Driver". I make a class for creating a connection as a AsyncTask. public class MySqlConnection extends AsyncTask<...
Fame th's user avatar
  • 1,018
1 vote
0 answers
49 views

Android/Java: HereMap Cant download Map w/ Class: I/Choreographer: Skipped 1390 frames! The application may be doing too much work on its main thread

I try to download the map of HereMap to use it offline, but when I create a class for this Here Map download, it initialized well, but the download is not starting... The error message is: I/...
ΩlostA's user avatar
  • 2,481
0 votes
0 answers
26 views

Cannot run a background task in andorid studio using AsyncTask

I am trying to run a task at background using AsyncTask, but it isn't working I have tried a lot of solutions but none worked. My code should show me html codes of prothomalo.com at the logcat, but is ...
Md. Abdullah Sarder's user avatar
0 votes
0 answers
43 views

Too many operations slowing down main thread which is causing delay in loading next acitivty

Apparently I have a scenario where my launcher activity is splash screen which contains a handler class to show animation on start. handler.postDelayed(new Runnable() { @Override ...
D3mon's user avatar
  • 91
0 votes
0 answers
125 views

The AsyncTask API is deprecated in Android 11. How to modify this code?

The AsyncTask API is deprecated in Android 11. How to modify this code? I was reading about AsyncTask, and I tried the simple program below. But it does not seem to work. How can I make it work? ...
Arun D's user avatar
  • 1
0 votes
0 answers
44 views

Async calls within Dart Stream processing

I'm aware of similar questions, but, they don't quite do it. I want to get NTP time and access an URL whenever an NFC token is read. I'm modifying the example from nfc_in_flutter. So, I have this: ...
Hugh Barnard's user avatar
1 vote
1 answer
55 views

How to replace AsyncTask in this code to find places according to a api call string

I'm getting this issue on my personal android project: i want to use google places api call to show and mark nearby and specific places on map but it does not work as intended because asyncTasks are ...
Dinuka Gunarathne's user avatar
0 votes
1 answer
30 views

Why does this web service code not output?

I am a beginner Android developer, I wrote this code related to web service, but this program has no output (I am not getting any error). And I'm sure that the API is correct, but it doesn't show ...
Omid Rikazadeh's user avatar

1
2 3 4 5
291