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/smand1 and http://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 For more options, visit this group at http://groups.google.com/group/android-developers?hl=en