Skip to content

Commit

Permalink
add webview download
Browse files Browse the repository at this point in the history
  • Loading branch information
jwzha committed Jul 24, 2013
1 parent c0f76c7 commit b4e1d93
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 0 deletions.
Binary file modified bin/classes/com/jwzhangjie/videoplayer/online/WebVideo$1.class
Binary file not shown.
Binary file modified bin/classes/com/jwzhangjie/videoplayer/online/WebVideo$2.class
Binary file not shown.
Binary file not shown.
Binary file modified bin/classes/com/jwzhangjie/videoplayer/online/WebVideo.class
Binary file not shown.
14 changes: 14 additions & 0 deletions src/com/jwzhangjie/videoplayer/online/WebVideo.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.view.KeyEvent;
import android.webkit.DownloadListener;
import android.webkit.WebChromeClient;
import android.webkit.WebView;
import android.webkit.WebViewClient;
Expand Down Expand Up @@ -45,6 +48,16 @@ public void onProgressChanged(WebView view, int newProgress) {
}

});
MyWebView.setDownloadListener(new DownloadListener() {

@Override
public void onDownloadStart(String url, String userAgent,
String contentDisposition, String mimetype, long contentLength) {
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
startActivity(intent);
}
});
MyWebView.loadUrl("http://www.google.hk");
}

Expand All @@ -69,5 +82,6 @@ public boolean onKeyDown(int keyCode, KeyEvent event) {
return super.onKeyDown(keyCode, event);
}


private WebView MyWebView;
}

0 comments on commit b4e1d93

Please sign in to comment.