android - 如何删除android中的短信?

标签 android

我想从 Android 的收件箱中删除特定的短信,如何查询特定的短信?

最佳答案

您可以在普通的 Android 应用程序中发送或接收短信,这不是默认的短信应用程序,但您不能删除它。所有 4.4 以上的设备只能有一个默认的短信应用程序。您可以要求用户将您的应用程序作为通过在 list 中放置一个权限来默认短信应用程序,在此之后,所有短信将仅使用您的应用程序写入短信提供商,但用户是否选择您的应用程序来发送和接收短信完全取决于用户。如果您的应用程序是默认短信应用程序,那么您可以删除短信。 使您的应用程序成为默认短信应用程序的 list 在这里: ...

    <!-- BroadcastReceiver that listens for incoming MMS messages -->
    <receiver android:name=".MmsReceiver"
        android:permission="android.permission.BROADCAST_WAP_PUSH">
        <intent-filter>
            <action android:name="android.provider.Telephony.WAP_PUSH_DELIVER" />
            <data android:mimeType="application/vnd.wap.mms-message" />
        </intent-filter>
    </receiver>

    <!-- Activity that allows the user to send new SMS/MMS messages -->
    <activity android:name=".ComposeSmsActivity" >
        <intent-filter>
            <action android:name="android.intent.action.SEND" />                
            <action android:name="android.intent.action.SENDTO" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.BROWSABLE" />
            <data android:scheme="sms" />
            <data android:scheme="smsto" />
            <data android:scheme="mms" />
            <data android:scheme="mmsto" />
        </intent-filter>
    </activity>

    <!-- Service that delivers messages from the phone "quick response" -->
    <service android:name=".HeadlessSmsSendService"
             android:permission="android.permission.SEND_RESPOND_VIA_MESSAGE"
             android:exported="true" >
        <intent-filter>
            <action android:name="android.intent.action.RESPOND_VIA_MESSAGE" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:scheme="sms" />
            <data android:scheme="smsto" />
            <data android:scheme="mms" />
            <data android:scheme="mmsto" />
        </intent-filter>
    </service>
</application>

关于android - 如何删除android中的短信?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5763945/

相关文章:

android - 保持 View 实例处于 Activity 状态还是每次都获取它?

android - RecyclerView拦截滚动并停止滚动到特定位置

android - 使用TabLayout和ViewPager时,应用程序在选项卡2的后退按钮上崩溃

android - AlertDialog.Builder 中 EditText 的自动键盘显示

Android以编程方式打开/关闭WiFi热点

java - Gradle 重复条目 : build failed

android - 自动完成 TextView 不起作用

android - KR070PC7S LCD 显示器的 Linux 或 Android 驱动程序

安卓谷歌地图问题

android - 具有锚定顶部和底部的 RelativeLayout?