Thank You, overriding dispatchKeyEvent works fine!

But, just to clarify, the job of XWalkUICLient::shouldOverrideKeyEvent is not 
filtering KeyEvent? Why it is not working here?
Thank You, 
Daniele Gibertoni
 

     Il Martedì 17 Marzo 2015 13:40, "Xu, Xing" <[email protected]> ha scritto:
   

 #yiv2733709212 #yiv2733709212 -- _filtered #yiv2733709212 
{font-family:Helvetica;panose-1:2 11 6 4 2 2 2 2 2 4;} _filtered #yiv2733709212 
{font-family:宋体;panose-1:2 1 6 0 3 1 1 1 1 1;} _filtered #yiv2733709212 
{panose-1:2 4 5 3 5 4 6 3 2 4;} _filtered #yiv2733709212 
{font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;} _filtered #yiv2733709212 
{panose-1:2 1 6 0 3 1 1 1 1 1;}#yiv2733709212 #yiv2733709212 
p.yiv2733709212MsoNormal, #yiv2733709212 li.yiv2733709212MsoNormal, 
#yiv2733709212 div.yiv2733709212MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:12.0pt;}#yiv2733709212 a:link, 
#yiv2733709212 span.yiv2733709212MsoHyperlink 
{color:#0563C1;text-decoration:underline;}#yiv2733709212 a:visited, 
#yiv2733709212 span.yiv2733709212MsoHyperlinkFollowed 
{color:#954F72;text-decoration:underline;}#yiv2733709212 
span.yiv2733709212EmailStyle17 {color:#1F497D;}#yiv2733709212 
.yiv2733709212MsoChpDefault {font-size:10.0pt;} _filtered #yiv2733709212 
{margin:1.0in 1.25in 1.0in 1.25in;}#yiv2733709212 div.yiv2733709212WordSection1 
{}#yiv2733709212 How about try to override Activity::dispatchKeyEvent?    From: 
Crosswalk-help [mailto:[email protected]]On 
Behalf Of Daniele Gibertoni
Sent: Tuesday, March 17, 2015 8:16 PM
To: [email protected]
Subject: [Crosswalk-help] shouldOverrideKeyEvent and Back button on embedded 
webview    Hello. We have an Android app that use an embedded Crosswalk 
XWalkView (stable version 11.40.277.7). We would like to disable the default 
behavior of hardware back button (go back on webview history) in order to have 
it handled by our application. It seems that is not possible to do: the 
Crosswalk webview will always handles the back button press and changes the 
page.    Our relevant code in XWalkUIClient:    @Override
    public boolean shouldOverrideKeyEvent(XWalkView view,  
android.view.KeyEvent event){
        int keycode=event.getKeyCode();          
        if(keycode==KeyEvent.KEYCODE_BACK){
            return true;
        }
        return false;
    }    Our code in main Activity:    public void onBackPressed() {
}    @Override
      public boolean onKeyDown(int keyCode, KeyEvent event){          
          if ((keyCode == KeyEvent.KEYCODE_BACK) ) {              
              return true;
          }
          return super.onKeyDown(keyCode,event);
      }    We are missing something? Thank You!    Daniele Gibertoni       

   
_______________________________________________
Crosswalk-help mailing list
[email protected]
https://lists.crosswalk-project.org/mailman/listinfo/crosswalk-help

Reply via email to