Breaking News


Friday 27 December 2013

WEB VIEW ANDROID EXAMPLE

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....
Share This
Blogger
Facebook
Disqus

comments powered by Disqus

1 comment :

Subscribe
Labels
Popular Posts

Subscribe Via Email

About Us

THIS IS ANDROID AND JAVA FREE TUTORIAL AND ALL PROVIDE SOLUTION IN ANDROID AND JAVA INTERVIEW QUE AND ANS IS AVAILABLE IN MY BLOG AND ANY QUERY PLEASE CONTACT ME GO NOW CONTACT US PAGE.

Total Pageviews

© Android and Java solution All rights reserved | Designed By Fireandroids