读书人

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

发布时间: 2012-03-12 12:45:33 作者: rapoo

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

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

读书人网 >Android

热点推荐