Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Android Eclipse SDK
Hi, 
 
I want to work with webview now and i cant seem to find any tutorials. im looking to just do a make a textbox navigate the webview to a website.
 
here is my view xml if this helps
 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >
 
    <WebView
        android:id="@+id/webView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/linearLayout1" />
 
    <LinearLayout
        android:id="@+id/linearLayout1"
        android:layout_width="wrap_content"
        android:layout_height="60dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true"
        android:removed="@drawable/actionbar" >
 
        <Button
            android:id="@+id/button1_back"
            android:layout_width="42dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text="<" />
 
        <Button
            android:id="@+id/button3_forward"
            android:layout_width="41dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text=">" />
 
        <EditText
            android:id="@+id/editText1_url"
            android:layout_width="124dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_weight="0.64"
            android:ems="20"
            android:inputType="textEmailAddress" >
 
            <requestFocus />
        </EditText>
 
        <Button
            android:id="@+id/button2navigate"
            android:layout_width="48dp"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:text="Go" />
    </LinearLayout>
 
</RelativeLayout>
any help would be good!
 
Thanks
Posted 28-Nov-12 17:27pm

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

EditText url;
 
url=(EditText) findViewById(R.id.editText_password);
inside btn click event
WebView page=(WebView)findVieById(R.Id.webview1);
page.loadUrl(url);
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 400
1 Sergey Alexandrovich Kryukov 329
2 Afzaal Ahmad Zeeshan 264
3 BillWoodruff 245
4 CPallini 195
0 OriginalGriff 5,560
1 DamithSL 4,476
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web03 | 2.8.141216.1 | Last Updated 17 Jul 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100