0

我的私人应用程序接收广播短信。我想从特定号码中止短信。为此,我将我的私人应用程序设为默认应用程序。现在每条短信都会自动中止,消息应用程序无法接收任何短信。

请指导我哪里错了。我不想中止所有短信。

谢谢

我附上了我的 manifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.muhammadnaveed.test2">

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="23" />

    <!-- Permissions to receive and read SMS -->
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.READ_SMS" />
    <uses-permission android:name="android.permission.READ_CONTACTS"/>
    <uses-permission android:name="android.permission.WRITE_CONTACTS"/>


    <application
        android:allowBackup="true"
        android:icon="@mipmap/contact1"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/contact2"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        <activity android:name="com.example.muhammadnaveed.AutoSaveContact.AutoContactSave">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

        <!-- BroadcastReceiver that listens for incoming SMS messages -->
        <receiver android:name="com.example.muhammadnaveed.AutoSaveContact.SMSBReceiver"
            android:permission="android.permission.BROADCAST_SMS">
            <intent-filter android:priority="1000">
                <action android:name="android.intent.action.PHONE_STATE" />
                <action android:name="PACKAGE_NAME.android.action.broadcast"/>
                <action android:name="android.provider.Telephony.SMS_RECEIVED"/>
                <action android:name="android.provider.Telephony.SMS_DELIVER"/>

            </intent-filter>
        </receiver>

        <!-- 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=".SendSms">
            <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>
        <activity android:name="com.example.muhammadnaveed.AutoSaveContact.MessageList">

        </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>

</manifest>
4

0 回答 0