android - Scroll webView with volume keys -


how scroll webview w/ volume hard keys? ...and can done easing? if so, how? i'm noob android - coming on actionscript , appreciated.

my r.id.webpg001 webview id. 

this i'm @ now:

@override   public boolean dispatchkeyevent(keyevent event) {       int action = event.getaction();       int keycode = event.getkeycode();       scrollview scrollview;       scrollview = (scrollview) findviewbyid(r.id.webpg001);                   switch (keycode) {           case keyevent.keycode_volume_up:               if (action == keyevent.action_up) {                   scrollview.pagescroll(scrollview.focus_up);                   scrollview.computescroll();                }               return true;           case keyevent.keycode_volume_down:               if (action == keyevent.action_up) {           scrollview.pagescroll(scrollview.focus_down);                   scrollview.computescroll();                }               return true;           default:               return super.dispatchkeyevent(event);           }       } 

here correct code: (thnx ndru!!)

@override public boolean dispatchkeyevent(keyevent event) {     int action = event.getaction();     int keycode = event.getkeycode();     webview scrollview = (webview) findviewbyid(r.id.ch01);              switch (keycode) {         case keyevent.keycode_volume_up:             if (action == keyevent.action_down) {                 scrollview.pageup(false);                }             return true;         case keyevent.keycode_volume_down:             if (action == keyevent.action_down) {                 scrollview.pagedown(false);             }             return true;         default:             return super.dispatchkeyevent(event);         }     }  

Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -