Add two webview in framelayout

Posted by user1478916 on Stack Overflow See other posts from Stack Overflow or by user1478916
Published on 2012-07-08T02:34:14Z Indexed on 2012/07/08 3:15 UTC
Read the original article Hit count: 125

Filed under:
|
|

I want to add two webview in a layout..I use frameLayout

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" >


    <WebView
        android:id="@+id/webview1"
        android:layout_width="350dip"
        android:layout_height="350dip" />


    <WebView
        android:layout_height="250dip"
        android:layout_width="250dip"
        android:id="@+id/webview2"    
    />

    </FrameLayout>

And in Main Activity :

    web1=(WebView)findViewById(R.id.webview1);
    web2=(WebView)findViewById(R.id.webview2);

    web1.loadUrl("http://www.google.com");
    web2.loadUrl("http://www.youtube.com");

    web2.setOnClickListener(new OnClickListener() {

        public void onClick(View v) {
            // TODO Auto-generated method stub
            Animation anim=AnimationUtils.loadAnimation(FrameWebViewActivity.this, android.R.anim.slide_in_left);
            web2.setAnimation(anim);
        }
    });

But when run project,it only display webview youtube full screen ..I want to display both two webview..What i must do??

© Stack Overflow or respective owner

Related posts about android

Related posts about webview