Monday, March 3, 2014

WebView


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


package = "com.yaxh"
android: versionCode = "1"
android: versionName = "1.0">



android: label = "@ string / app_name">







<-! 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:
cited a floor ultrapro reply:
browser can access it?
URL right?

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:
The reply was deleted at the moderator 2011-05-20 08:48:53

Reply:
references, 5th Floor ya_xiaohu reply:
Thank you both, the problem has been solved,
The problem is that when writing URL must be preceded http
Hey ......
I am grateful ......
Oh Sometimes a small problem is really a headache ah mess
Reply:
reference to the 7th floor aomandeshangxiao reply:
references, 5th Floor ya_xiaohu reply:

Thank you both, the problem has been solved,
The problem is that when writing URL must be preceded http
Hey ......
I am grateful ......
Oh Sometimes the problem is a little mess is really a headache ah


Well ......
So any problems are problems do not underestimate it ......
Reply:
The reply was deleted at the moderator 2011-12-02 11:27:48

Reply:
added http. Not so that, why yet. . .

No comments:

Post a Comment