---
title: "在android4.4以上版本 第三方应用处理短信的疑惑"
author: "hellorheaven"
date: "2015-03-31T16:14:45Z"
tags: []
categories: ["移动开发"]
slug: "android4-4"
draft: false
lastmod: "2015-03-31T16:14:45Z"
id: 2197423
url: "https://hellorheaven.iteye.com/blog/2197423"
---

最近有个处理android手机短信的需求，需要删除本地某指定短信

代码大同小异


```java

delete(Uri.parse("content://sms/sent/"),
					"_id=" + _id, null);
```


但删除后返回值一直是0，也未报错。

反复对比网上的一些示例，没什么分别。

后来查了一些资料，才知道，谷歌为了保护用户隐私，第三方应用不可以操作删除短信

除非，申请为默认的短信应用。（我的nexus5 默认的是环聊）

参考<http://segmentfault.com/q/1010000001603263>