首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

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

2012-03-12 
如何在代码里模拟后退操作比如我按我界面上的按钮就等于 按了后退键[解决办法]Override this method./***

如何在代码里模拟后退操作
比如我按我界面上的按钮 就等于 按了后退键

[解决办法]
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();
}

热点排行