---
title: "How to destroy an Activity in android"
author: "fonter"
date: "2009-09-26T11:03:58Z"
tags: []
slug: "how-to-destroy-an-activity-in-android"
draft: false
lastmod: "2009-10-21T15:23:49Z"
id: 477769
url: "https://fonter.iteye.com/blog/477769"
---

销毁android Activity方法如下：

 

```
    public void onDestroy() { 
        try{ 
             //这里是你需销毁的事件
        } 
        catch(Exception ex){} 
        super.onDestroy(); 
    }
```

 

 

用finish()方法会调用onDestroy()，即可销毁一个Activity

 

[iWidsets公告](http://fonter.iteye.com/blog/498654)

[android调用平台功能](http://fonter.iteye.com/blog/498636)

[android Httpclient 设置timeout](http://fonter.iteye.com/blog/497309)

[android与j2me移植之clipRect](http://fonter.iteye.com/blog/492110)

[android混淆(Obfuscate)](http://fonter.iteye.com/blog/489728)

[How to destroy an Activity in android](http://fonter.iteye.com/blog/477769)

[android应用程序logcat命令](http://fonter.iteye.com/blog/477112)

[android开玩笑之创建xml文件](http://fonter.iteye.com/blog/477066)

[android和j2me之清屏(clearScreen)](http://fonter.iteye.com/blog/474922)

[android之view获取getWidth()和getHeight()](http://fonter.iteye.com/blog/474900)

[android之创建和读取自定义资源文件](http://fonter.iteye.com/blog/474584)

[android之显示Log](http://fonter.iteye.com/blog/474535)

[androd之绘制文本（FontMetrics）](http://fonter.iteye.com/blog/474526)