| | |
| | | package com.weikou.beibeivideo.ui.mine; |
| | | |
| | | import android.app.AlertDialog; |
| | | import android.app.Notification; |
| | | import android.app.NotificationChannel; |
| | | import android.app.NotificationManager; |
| | | import android.content.DialogInterface; |
| | | import android.content.Intent; |
| | | import android.graphics.BitmapFactory; |
| | | import android.graphics.Color; |
| | |
| | | import android.widget.Toast; |
| | | |
| | | import com.lcjian.library.util.ManifestDataUtil; |
| | | import com.tencent.smtt.export.external.interfaces.ConsoleMessage; |
| | | import com.tencent.smtt.export.external.interfaces.SslError; |
| | | import com.tencent.smtt.export.external.interfaces.SslErrorHandler; |
| | | import com.tencent.smtt.export.external.interfaces.WebResourceRequest; |
| | |
| | | import com.weikou.beibeivideo.ui.media.VideoDetailActivity; |
| | | import com.weikou.beibeivideo.ui.media.VideoDetailActivity2; |
| | | import com.weikou.beibeivideo.util.browser.BWJavaInterface; |
| | | import com.weikou.beibeivideo.util.browser.PPJavaInterface; |
| | | import com.weikou.beibeivideo.util.downutil.DownFiles; |
| | | import com.weikou.beibeivideo.util.downutil.DownFiles.IProgress; |
| | | import com.weikou.beibeivideo.util.x5.X5WebView; |
| | |
| | | import java.util.Map; |
| | | |
| | | public class BrowserActivity extends BaseActivity implements OnClickListener { |
| | | private final static String TAG = "BrowserActivity"; |
| | | |
| | | private TextView tv_top_bar_left; |
| | | private TextView tv_top_bar_left2; |
| | |
| | | if (url != null && url.startsWith("weixin://")) { |
| | | Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); |
| | | startActivity(intent); |
| | | return true; |
| | | } else if (url.startsWith("alipays:") || url.startsWith("alipay")) { |
| | | try { |
| | | startActivity(new Intent("android.intent.action.VIEW", Uri.parse(url))); |
| | | } catch (Exception e) { |
| | | new AlertDialog.Builder(BrowserActivity.this) |
| | | .setMessage("未检测到支付宝客户端,请安装后重试。") |
| | | .setPositiveButton("立即安装", new DialogInterface.OnClickListener() { |
| | | |
| | | @Override |
| | | public void onClick(DialogInterface dialog, int which) { |
| | | Uri alipayUrl = Uri.parse("https://d.alipay.com"); |
| | | startActivity(new Intent("android.intent.action.VIEW", alipayUrl)); |
| | | } |
| | | }).setNegativeButton("取消", null).show(); |
| | | } |
| | | return true; |
| | | } else if (url != null && url.startsWith("buwanprotocol://")) { |
| | | String murl = url.split("buwanprotocol://")[1]; |
| | |
| | | } |
| | | super.onProgressChanged(webView, i); |
| | | } |
| | | |
| | | @Override |
| | | public boolean onConsoleMessage(ConsoleMessage consoleMessage) { |
| | | Log.i(TAG, consoleMessage.message()); |
| | | return super.onConsoleMessage(consoleMessage); |
| | | } |
| | | }); |
| | | WebSettings webSetting = webview.getSettings(); |
| | | webSetting.setJavaScriptEnabled(true); |
| | |
| | | tv_top_bar_left.setOnClickListener(this); |
| | | tv_top_bar_left2.setOnClickListener(this); |
| | | |
| | | progressBar = (ProgressBar) findViewById(R.id.myProgressBar); |
| | | progressBar = findViewById(R.id.myProgressBar); |
| | | progressBar.setMax(100); |
| | | progressBar.setProgressDrawable(this.getResources() |
| | | .getDrawable(R.drawable.color_progressbar)); |
| | | initX5WebView(); |
| | | webview.loadUrl(getIntent().getStringExtra("url")); |
| | | String url = getIntent().getStringExtra("url"); |
| | | // String url="http://192.168.3.122:8848/buwan-web/BuWanWeb/vip/index.html"; |
| | | webview.loadUrl(url); |
| | | } |
| | | |
| | | // 文件下载监听 |
| | | |
| | | private class MyWebViewDownLoadListener implements DownloadListener { |
| | |
| | | super.onResume(); |
| | | MobclickAgent.onPageStart("网页"); |
| | | // webview.reload(); |
| | | if(webview!=null){ |
| | | webview.loadUrl("javascript:onResume()"); |
| | | } |
| | | } |
| | | |
| | | @Override |