我正在处理消息的发送和接收,我通过广播接收器收到了许多消息接收的答案,但是没有发送消息的解决方案。如何检测发送的消息?
<receiver
android:name="com.test.services.MessageReciver"
android:enabled="true"
android:permission="android.permission.BROADCAST_SMS" >
<intent-filter>
<action android:name="android.provider.Telephony.SMS_DELIVER" />
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
public static final String ACTION_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
public static final String ACTION_SENT = "android.provider.Telephony.SMS_DELIVER";
Context context;
@Override
public void onReceive(Context context, Intent intent) {
// this section works only when message received on in case of sent
}
但是,只有消息的广播接收器接收到的工作不是为发送的消息。
感谢,但我发送从默认消息应用程序的消息。我想检测从设备默认应用程序发送currnlty的消息,而不是来自定制应用程序。 –
OP不想发送短信,他想要检测何时发送短信 –