<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
compile 'com.just.agentweb:agentweb:3.1.0'
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.administrator.myapplication.MainActivity">
<LinearLayout
android:orientation="vertical"
android:id="@+id/mldz_chufanginfo_weblayout"
android:layout_width="match_parent"
android:layout_height="match_parent"></LinearLayout>
</LinearLayout>
public class MainActivity extends AppCompatActivity {
private LinearLayout mldzChufanginfoWeblayout;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
mldzChufanginfoWeblayout=(LinearLayout)findViewById(R.id.mldz_chufanginfo_weblayout) ;
AgentWeb mAgentWeb = AgentWeb.with(this)//传入Activity
.setAgentWebParent(mldzChufanginfoWeblayout, new LinearLayout.LayoutParams(-1, -1))//传入AgentWeb 的父控件 ,如果父控件为 RelativeLayout , 那么第二参数需要传入 RelativeLayout.LayoutParams
.useDefaultIndicator()// 使用默认进度条
.defaultProgressBarColor() // 使用默认进度条颜色
.createAgentWeb()//
.ready()
.go("http://e.firefoxchina.cn/");
}
}