I have a class that goes to decrease the image but I’m currently on AsyncTask, now I want to replace it because AsyncTask is now deprecated.So can someone help me out with a workaround Here is my code: Answer You could change your decreaseImageSize to accept a callback as a parameter. In this case, the function will no longer need
Tag: android-asynctask
Define text color based on value using AsyncTask
So basically my AsyncTask get the value from the url and when i execute i wanna show green text or red text if contains (“-“). I have search around and none of the option worked for me. i do have a RecyclerView.ViewHolder but don’t know how to incorporate before i execute. Everything works, except the colors. Thank you in advance
“getText” syntax is not working and it’s showing error
“getText” syntax is not working and it’s showing error. i am not able to get answer, expected answer is, should able retrieve username, password and match it to the username password which we enter, but now i couldn’t able to match both. Answer Now when calling the asynctask in your Activity do this Pass the values of the EditText while
Retrieve Context from a fragment
I created a class to retrieve comments from a JSON encoding from a PHP file. This class, extends from AsyncTask: As you can see, I’m trying to show a ProgressDialog while the “doInBackground” proccess is working. But progressDialog constructor, asks for a Context, and I don’t know how to provide it. I’m calling this class from a Fragment, so I
Possible to determine size of file to be downloaded?
I currently have the following code which reads a file located on the web and writes it to a file on the phone: Does anyone know whether it is possible (using the setup above or otherwise) to determine the total number of bytes which are to be read before commencing with the download (in order to publish percentage progress to
How to check internet access on Android? InetAddress never times out
I got a AsyncTask that is supposed to check the network access to a host name. But the doInBackground() is never timed out. Anyone have a clue? public class HostAvailabilityTask extends AsyncTask<…