当前位置: 代码迷 >> Android >> 怎么在代码里模拟后退操作
  详细解决方案

怎么在代码里模拟后退操作

热度:88   发布时间:2016-05-01 21:58:30.0
如何在代码里模拟后退操作
比如我按我界面上的按钮 就等于 按了后退键

------解决方案--------------------
Override this method.

/**
* Called when the activity has detected the user's press of the back
* key. The default implementation simply finishes the current activity,
* but you can override this to do whatever you want.
*/
public void onBackPressed() {
finish();
}
  相关解决方案