" android.provider.Telephony.SMS_RECEIVED"不工作我的设备(HTC野火)上 - 如何调试? [英] "android.provider.Telephony.SMS_RECEIVED" not working on my device (HTC Wildfire) - how to debug?

查看:157
本文介绍了" android.provider.Telephony.SMS_RECEIVED"不工作我的设备(HTC野火)上 - 如何调试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的脸真的很令人沮丧的问题。

I face really frustrating problem.

我在短信接收器,大多数网上和书籍的教程说。

I created SMS receiver as most online and book's tutorials say.

AndroidManifest.xml中:

AndroidManifest.xml:

<uses-sdk android:minSdkVersion="8" />
<uses-permission android:name="android.permission.RECEIVE_SMS" />

<application android:name="roboguice.application.RoboApplication"
             android:icon="@drawable/icon"
             android:label="@string/app_name"
             android:debuggable="true" >    

    <!-- ... other stuffs here ... -->

    <receiver android:name=".receivers.SmsReceiver"> 
        <intent-filter>
            <action android:name="android.provider.Telephony.SMS_RECEIVED" />
        </intent-filter>
    </receiver>
</application>

SmsReceiver.java:

SmsReceiver.java:

public class SmsReceiver extends BroadcastReceiver {

    public static final String TAG = "SmsReceiver";

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d(TAG, "SMS received!");
        Toast.makeText(context, "SMS received.", Toast.LENGTH_LONG).show();
    }
}

虽然它正常工作在模拟器(安卓2.2),它并没有对我的HTC野火(的Andr​​oid 2.2.1,没有根)。

While it works correctly on Emulator (Android 2.2) it doesn't work on my HTC Wildfire (Android 2.2.1, not rooted).

主要的问题是,我是新进的Andr​​oid deveopment和我完全不知道如何调试它。

The main problem is that I'm new into Android deveopment and I have completely no idea how to debug it.

我能找出一些有用的与LogCat中的日志sendt从我的HTC设备时收到短信?为什么我的设备的不同!?

Can I find out something usefull with LogCat logs sendt from my HTC device while it receives SMS message? Why is my device different!?

推荐答案

原因和放大器;解决方法

我已经解决这个问题。 android.provider.Telephony.SMS_RECEIVED是行不通的,因为我有我的安装设备上的GO短信应用程序,并有禁用其他消息通知选项选中(禁用通知其他SMS相关的应用程序的通知酒吧,避免重复的通知。的)。取消选中它解决了我的问题。

I've fix that. "android.provider.Telephony.SMS_RECEIVED" was not working because I had "GO SMS Pro" application installed on my device and there was "Disable other message notification" option checked ("Disable other SMS related apps' notification in notification bar, avoid duplicate notifications."). Unchecking it fixed my problem.

如何确保我的广播接收器将接收这个意图,即使一些其他的应用程序块吗?由于安卓优先(<一href="http://www.it-hall.com/1871/intercept-sms-messages-in-android-and-$p$pvent-them-appearing-in-messaging-app/">Intercept在Android和$ P $短信pvent它们出现在消息应用程序)我怎么能知道什么是优先级设置为GO短信应用程序?

How to make sure that my broadcast receiver will receive this intent even if some other app blocks it? Due to "android:priority" (Intercept SMS messages in Android and prevent them appearing in Messaging App) how can I know what "priority" is set for "GO SMS Pro" app?

这篇关于&QUOT; android.provider.Telephony.SMS_RECEIVED&QUOT;不工作我的设备(HTC野火)上 - 如何调试?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆