I wrote a simple WebView browser but can not always show page not found
I have a list of documents in there but it is not configured to use, thank you ah! Please help me find
heroesThe following is part of the code
public class MianActivity extends Activity {
/ ** Called when the activity is first created. * /
private Button button;
private EditText editText;
private WebView webView;
@ Override
public void onCreate (Bundle savedInstanceState) {
super.onCreate (savedInstanceState);
setContentView (R.layout.main);
button = (Button) findViewById (R.id.button);
editText = (EditText) findViewById (R.id.url);
webView = (WebView) findViewById (R.id.web);
/ / When clicking the mouse when the event
button.setOnClickListener (new Button.OnClickListener () {
@ Override
public void onClick (View v) {
/ / Set to get content EditText inside
String strURL = editText.getText () toString ();.
Web Data
/ / display inside the WebViewwebView.loadUrl (strURL);
. Toast.makeText (MianActivity.this, getString (R.string.load) + strURL, Toast.LENGTH_LONG) show ();
}
});
}
}
The following is a Mianfest.xml configuration file inside the code
android: versionCode = "1"
android: versionName = "1.0">
<-! Access to the network ->
<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
Browser access to the Internet it?
URL right?
Reply:
Then add that
list of permissions in AndroidManifest.xmlandroid.permission.ACCESS_NETWORK_STATE permissions control access to network status
You can not try
Reply:
Internet
URL is right ah
Reply:
No solution

Reply:
Thank you both, the problem has been solved,
The problem is that when writing URL must be preceded http
Hey ......
I am grateful ......
Reply:
Reply:
Oh Sometimes a small problem is really a headache ah mess
Reply:
Well ......
So any problems are problems do not underestimate it ......
Reply:
Reply:
added http. Not so that, why yet. . .
No comments:
Post a Comment