WebView is not final class, so yes you can extend from WebView.

On 5 фев, 12:31, sagar masuti <sagar....@gmail.com> wrote:
> Hi Mark,
>
> I have implemented a class named WidgetView.java which extends from
> FrameLayout.
> This acts as a container for Webview.In my class I handle the touch events
> according to my specific requirements.
> Now when i remove FrameLayout and use some other layout I am not able to
> display any content.
> Could you please suggest a way wherein I can display the contents and also
> handle the touch events as per my requirements.
> Is it possible for me to extend my WidgetView.java class directly from
> WebView.java.Any pointers will be highly appreciated.
> Thanks in advance.
>
> Regards,
> Sagar
>
> On Fri, Feb 4, 2011 at 3:13 AM, Mark Murphy <mmur...@commonsware.com> wrote:
> > On Wed, Feb 2, 2011 at 5:42 AM, sagar masuti <sagar....@gmail.com> wrote:
> > > I am trying to embedded a webview in a framelayout. my launch.xml is
> > > as shown below.
>
> > > <FrameLayout xmlns:android="http://schemas.android.com/apk/res/
> > > android"
> > >        android:orientation="vertical"
> > >        android:layout_width="fill_parent"
> > >    android:layout_height="fill_parent" >
>
> > > <WebView
> > >    android:id="@+id/webview"
> > >    android:layout_width="fill_parent"
> > >    android:layout_height="fill_parent"/>
> > > </FrameLayout>
>
> > Why do you have a FrameLayout?
>
> > Why do you have android:orientation="vertical" in your FrameLayout,
> > considering that FrameLayout does not honor that attribute?
>
> > > I have implemented the WebChromeClient and WidgetViewClient.
>
> > That's WebViewClient.
>
> > > I have
> > > implemented the onTouchEvent and passing the touch events to the
> > > WebView.
>
> > That seems unlikely to work well.
>
> > > The problem i am facing is am not able to scroll inside the webview.
> > > For example, the content is some 5 lines then am able to see only 3
> > > lines and not able to scroll.
>
> > > The touch events go to Webview, first action_down and then
> > > action_move, am not able to get what wrong am doing??
>
> > You are assuming that WebView is like any other widget. It is not. It
> > is implemented via WebKit, which has its own notions of event handling
> > that may or may not blend well with your own touch event  handling.
>
> > What are you trying to achieve by intercepting the touch events?
>
> > Since WebView knows how to scroll on its own, I would recommend you
> > simply get rid of the FrameLayout and your own touch handling, and let
> > WebView do what it does naturally.
>
> > --
> > Mark Murphy (a Commons Guy)
> >http://commonsware.com|http://github.com/commonsguy
> >http://commonsware.com/blog|http://twitter.com/commonsguy
>
> > Android Training in London:http://bit.ly/smand1andhttp://bit.ly/smand2
>
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-developers@googlegroups.com
> > To unsubscribe from this group, send email to
> > android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> > For more options, visit this group at
> >http://groups.google.com/group/android-developers?hl=en

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

Reply via email to