We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to get progress (percent) when downloading image from url . I think i should customize code at HttpUrlDownloader.java
Here it's what i'm going so far ::
while (true) { final URL u = new URL(thisUrl); urlConnection = (HttpURLConnection) u.openConnection(); urlConnection.setInstanceFollowRedirects(true); if (mRequestPropertiesCallback != null) { final ArrayList<NameValuePair> props = mRequestPropertiesCallback.getHeadersForRequest(context, url); if (props != null) { for (final NameValuePair pair : props) { urlConnection.addRequestProperty(pair.getName(), pair.getValue()); } } } if (urlConnection.getResponseCode() != HttpURLConnection.HTTP_MOVED_TEMP && urlConnection.getResponseCode() != HttpURLConnection.HTTP_MOVED_PERM) break; thisUrl = urlConnection.getHeaderField("Location"); } if (urlConnection.getResponseCode() != HttpURLConnection.HTTP_OK) { UrlImageViewHelper.clog("Response Code: " + urlConnection.getResponseCode()); return null; } is = urlConnection.getInputStream(); //customize int fileLength = urlConnection.getContentLength(); byte data[] = new byte[1024]; long total = 0; int count; while ((count = is.read(data)) != -1) { total += count; publishProgress((int) (total * 100 / fileLength)); } callback.onDownloadComplete(HttpUrlDownloader.this, is, null); return null;
I can get progress by publishProgress , but when progress = 100% then ImageView not show
Sorry , My English is bad :( .Help me !!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
How to get progress (percent) when downloading image from url .
I think i should customize code at HttpUrlDownloader.java
Here it's what i'm going so far ::
I can get progress by publishProgress , but when progress = 100% then ImageView not show
Sorry , My English is bad :( .Help me !!
The text was updated successfully, but these errors were encountered: