I'm trying to download a video from a URL, I applied my upload method to doInBackground () asynctask, but the doInBackground method takes a long time to get a call (5-10 minutes), I use another asyntask to load the image into the action from which I I'm going to download video activity and its work. My onPreExecute method is called on time, but after that doInBackground takes almost 5-7 minutes to start. I will be very grateful for any help provided. Here is my code
btnDownloadLQ.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { try { new DownloadVideoTask().execute(videoURL); } catch(Exception e) { Log.e("Vidit_TAG","I got an error",e); } } }); private class DownloadVideoTask extends AsyncTask<String, String, String> { @SuppressWarnings("deprecation") @Override protected void onPreExecute() { super.onPreExecute(); showDialog(DIALOG_DOWNLOAD_PROGRESS); } protected String doInBackground(String... urls) { int i=0; try { URL url = new URL (urls[0]); InputStream input = url.openStream(); try {
android android-asynctask
Y0gesh gupta
source share