WEB VIEW ANDROID EXAMPLE
first create main.xml file and add web view edit text and one button
after create mainactivity.java file write code show below....
public class WebActivity extends Activity implements OnClickListener{
Button b;
EditText e;
WebView wb;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
b = (Button)findViewById(R.id.button1);
e = (EditText)findViewById(R.id.editText1);
wb = (WebView)findViewById(R.id.webView1);
b.setOnClickListener(this);
}
public void onClick(View v) {
wb.loadUrl(e.getText().toString());
}
}
After Write Url in Edit text and press button and go to the link....
enjoy it....
first create main.xml file and add web view edit text and one button
after create mainactivity.java file write code show below....
public class WebActivity extends Activity implements OnClickListener{
Button b;
EditText e;
WebView wb;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
b = (Button)findViewById(R.id.button1);
e = (EditText)findViewById(R.id.editText1);
wb = (WebView)findViewById(R.id.webView1);
b.setOnClickListener(this);
}
public void onClick(View v) {
wb.loadUrl(e.getText().toString());
}
}
After Write Url in Edit text and press button and go to the link....
enjoy it....
Tha_x....
ReplyDelete