Hello,

My requirement is to create an activity that holds WebView.
I want my activity to load WebView by creating WebView objects as per
the requirements i.e. for every new web pageI want to reuse my
activity.

For this I have a layout for my activity. And I create new WebView for
each request.

Now my problem is I am unable to view the contents of the object I am
creating.

here is my code snippet please tell me what am I missing here.

        public void onCreate(Bundle savedInstanceState) {
                super.onCreate( savedInstanceState );

/* Layout of My Activity */
                mInflator = (FrameLayout)
LayoutInflater.from( this ).inflate(R.layout.main, null);
                mContentView = (FrameLayout)
mInflator.findViewById( R.id.webview_wrapper);

/* View having WebView */

                webViewInflator = (FrameLayout)
LayoutInflater.from( this ).inflate(R.layout.subLayout, null);
                myView = (WebView)
webViewInflator .findViewById( R.id.webview );

                WebView obj = new WebView
(this);                                                           //
this is my requirement
                obj .setWebViewClient( new
myWebViewClient( getApplicationContext() ) );
                obj .setWebChromeClient( new myWebChromeClient() );
                obj .getSettings().setJavaScriptEnabled(true);
                obj .loadUrl( url );

                myView = obj;
                mInflator.addView( webViewInflator );
        }

As per my requirement myView should load url that I am passing. Where
am I wrong?

Thanks for suggestions

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to