2017-08-10 193 views

回答

0

我們不支持該行爲,但您可以使用一點實施行爲hack。 Android中的後退按鈕編碼爲-23452,因此您可以覆蓋keyReleased中的Form並且不叫超級:

private long lastTimeReleased = -1; 
public void keyReleased(int keyCode) { 
    if(keyCode == -23452) { 
     // back key was released once, use your system logic 

     // return so normal key behavior doesn't happen here... 
     return; 
    } 
    // allow other keys to process normally 
    super.keyReleased(keyCode); 
} 
相關問題