引入依赖
implementation 'com.just.agentweb:agentweb:4.0.2'
初始化
ConstraintLayout ctlWeb = (ConstraintLayout) findViewById(R.id.ctl_web);
AgentWeb agentWeb = AgentWeb.with(this)
.setAgentWebParent(ctlWeb, new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.MATCH_PARENT))
.useDefaultIndicator()
.createAgentWeb()
.ready()
.go(getIntent().getStringExtra("url"));
agentWeb.getAgentWebSettings().getWebSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
常用方法:
//关闭进度条
AgentWeb.closeIndicator()