老師返回怎么改?
//d打開(kāi)菜單 ????public?void?openMenu() ????{ ????????if(isOpen)?return; ????????this.smoothScrollTo(0,0); ????????isOpen=true; ????} ????//關(guān)閉菜單 ????public?void?closeMenu() ????{ ????????if(!isOpen)return; ????????this.smoothScrollTo(mMenuWidth,0); ????????isOpen=false; ????} //切換菜單 ????@Override ????public?boolean?onKeyDown(int?keyCode,?KeyEvent?event)?{ ????????if(keyCode==KeyEvent.KEYCODE_BACK) ????????{ ???????????closeMenu(); ????????} ????????return?super.onKeyDown(keyCode,?event); ???????/*?return?isOpen=false;*/ ????} ????public?void?toggle(){ ????????if(isOpen) ????????{ ????????????closeMenu(); ????????}else ????????{ ????????????openMenu(); ????????} ????}
請(qǐng)問(wèn)如何監(jiān)聽(tīng)手機(jī)返回按鍵,,將菜單欄關(guān)閉,而不是直接退出程序。
2015-08-01
http://jingyan.baidu.com/article/fa4125acbb969a28ac7092aa.html
2015-08-01
額,同問(wèn)