戻るボタンを強制的に制御できる。
public boolean dispatchKeyEvent(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.KEYCODE_BACK) {
//ここで制御したい処理を書く。
if (e.getAction() == KeyEvent.ACTION_DOWN) {
return false;
}
return true;
}
return super.dispatchKeyEvent(e);
}
見れば分かるが、何も戻るボタンに限った話ではない。
2011-09-02 10:28
nice!(0)
コメント(0)
トラックバック(0)
共通テーマ:パソコン・インターネット
コメント 0