เมื่อพยายามเรียกใช้แอปพลิเคชัน webView แบบง่ายบน eclipse ด้วยคอมพิวเตอร์ที่มีการเข้าถึงอินเทอร์เน็ตพร็อกซีตัวจำลอง (nexus s) จะแสดง "ข้อผิดพลาดในการเข้าถึงแคชถูกปฏิเสธ" และด้านล่างว่า "ขออภัย คุณไม่ได้รับอนุญาตให้ร้องขอ http:/ จาก chache นี้จนกว่าคุณจะตรวจสอบตัวเอง APN ของโปรแกรมจำลองได้รับการตั้งค่าเป็นพร็อกซีและพอร์ตที่ถูกต้องตลอดจนชื่อผู้ใช้และรหัสผ่าน และอินเทอร์เน็ตใช้งานได้บนเครื่องจำลอง
รหัส :
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
String url = "http://www.google.it";
WebView view = (WebView) this.findViewById(R.id.webView1);
view.getSettings().setJavaScriptEnabled(true);
view.loadUrl(url);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}