---
title: "Android开发笔记——异常和错误及解决方法"
author: "JustOneCoder"
date: "2013-01-04T11:16:00Z"
tags: []
slug: "android"
draft: false
lastmod: "2013-07-09T18:15:28Z"
id: 1902148
url: "https://justonecoder.iteye.com/blog/1902148"
---

1.did not call through to super.onResume()

原因：重写onResume()的时候没有加上super.onResume();

解决方法：在onResume()加上super.onResume();就好了

**Button的Onclick事件新方法：**

在布局里的按钮里添加onclick属性，属性值为按钮事件的方法名字

```
<Button
            	android:layout_width="70dp"
            	android:layout_height="wrap_content"
            	android:layout_centerVertical="true"
            	android:text="返回"
            	android:textSize="14sp"
            	android:textColor="#fff"
            	android:onClick="shake_activity_back"
           		android:background="@drawable/title_btn_back"/>  
```

在Activity里只需要添加和按钮的onclick属性值对应的方法即可

```
	public void shake_activity_back(View v) {     //标题栏 返回按钮
      	this.finish();
      }  
```

**INSTALL\_FAILED\_INSUFFICIENT\_STORAGE 字面意思是：由于存储空间不足导致安装失败**