2012-11-07 86 views

回答

2

這有幫助嗎?

public boolean onKey(View v, int keyCode, KeyEvent event) { 
    switch (keyCode) { 
     case KEYCODE_HOME: 
//do whatever 
     break; 
     case KEYCODE_MENU: 
//do whatever 
     break; 
     case KEYCODE_VOLUME_DOWN: 
     case KEYCODE_VOLUME_UP: 
     break; 

     return true; 
    } 
    return false; 
} 
相關問題