摩托罗拉 Droid 2 全球短信发行
我希望有人能提供帮助。
我正在编写一个通过BroadcastReceiver 接收短信的Android 应用程序。它可以在许多 Android 设备上运行,但当我将其安装在摩托罗拉“Droid 2 Global”上时,它无法运行。我没有 Droid2Global 设备。我总是在 DeviceAnyWhere 上测试它,我的应用程序的用户也报告了这个问题。
为什么 Droid2Global 不同以及为什么这个 BroadcastReceiver 不能在此设备上工作?我正在使用静态广播接收器。
这是我的广播接收器代码。
public class SMSReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "SMS Received", Toast.LENGTH_LONG).show();
}
}
这是我对该接收器的清单条目。
<receiver android:name=".SMSReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
这是 BroadcastReceiver 的权限:
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
I am hoping someone can help.
I am writing an Android application which receive SMS through BroadcastReceiver. It is working in many Android devices but when I install it on Motorola "Droid 2 Global", it doesn't work. I have no Droid2Global device. I always test it on DeviceAnyWhere and my application's users report this issue as well.
Why Droid2Global is different and why this BroadcastReceiver is not working on this device? I am using static BroadcastReceiver.
This is my BroadcastReceiver code.
public class SMSReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context, "SMS Received", Toast.LENGTH_LONG).show();
}
}
This is my manifest entry for this receiver.
<receiver android:name=".SMSReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
This is permissions for BroadcastReceiver:
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试设置
以便它会首先通知所有短信接收器try to set
<intent-filter android:priority="999">
so it would be notified first of all SMS Receivers