[代码]Android 返回键返回上一级Activity
实现功能: 有两个Activity,一个为MainMenu,一个为PictureScribble,MainMenu进入PictureScribble后,在PictureScribble中单击返回键返回MainMenus.
public boolean OnKeyDown(int keyCode,KeyEvent event){ if (keyCode==KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { Intent myIntent; myIntent = new Intent(PictureScribble.this, MainMenu.class); startActivity(myIntent); this.finish(); } return false; }