0

I want to get a send number when I use MMS Message. I've done catch a send number in receiver like below :

<receiver
            android:name="com.example.orientationtest.MMSReceiver"
            android:permission="android.permission.BROADCAST_WAP_PUSH" >
            <intent-filter>
                <action android:name="android.intent.action.DATA_SMS_RECEIVED" />

                <data android:scheme="sms" />
                <data android:host="localhost" />
            </intent-filter>
            <intent-filter>
                <action android:name="android.provider.Telephony.WAP_PUSH_RECEIVED" />

                <data android:mimeType="application/vnd.wap.mms-message" />
            </intent-filter>
        </receiver>

However I cannot get a send number during mms send mode. When I try to send MMS, I just want to catch a send number.

Please somebody help me. Thx.

<uses-permission android:name="android.permission.SEND_MMS" />
Richard
  • 351
  • 4
  • 17

1 Answers1

0

There is no way to register a receiver for a sms message send event, see this post: Android Broadcast Receiver for Sent SMS messages?

There is a method to get the phone number of the device, see this post: https://stackoverflow.com/a/2480307/4409409

Be sure to read the caveats in the comments. Even though this seems to be the best way to get the phone number of the device, it's not guaranteed to work on all devices.

Documentation: http://developer.android.com/reference/android/telephony/TelephonyManager.html#getLine1Number()

Community
  • 1
  • 1
Daniel Nugent
  • 43,104
  • 15
  • 109
  • 137