Android应用程序没有响应短信接收器 [英] Android App Not Responding the SMS Receiver

查看:136
本文介绍了Android应用程序没有响应短信接收器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在一个应用程序来收到的短信做出回应(你抱怨之前,我知道这已经问了很多,但相信我,我不能让它在所有的工作,我已经试过搜索小时)。我有我的清单中设置像这样:

I have been working on an app to respond to received SMS messages (before you complain, I know this has been asked A LOT, but believe me, I can't get it to work at all, and I've tried searching for hours). I've got my manifest set up like so:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.csbctech.notiscreen"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" />

    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.RECEIVE_SMS"/>

    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >
        <activity
            android:name=".NotiScreenActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <receiver android:name="NotiScreenSmsReceiver" android:process=":remote">
            <intent-filter>
                <action android:name="android.provider.Telephony.SMS_RECEIVED"/>
            </intent-filter>
        </receiver>
    </application>

</manifest>

和我的接收器类看起来是这样的:

And my receiver class looks like this:

package com.csbctech.notiscreen;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.CountDownTimer;
import android.os.PowerManager;
import android.util.Log;

public class NotiScreenSmsReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        // TODO Auto-generated method stub
        Log.w("NotiScreen", "Got SMS");

    }


}

但NotiScreenSmsReceiver类不会被调用。我试过几个不同的例子,我不能为我的生命得到接收​​器类来获得所谓的......我甚至试图消除使用许可权,而我甚至不获取有关错误信息没有权限。可能是什么问题?哦,请大家帮我,你是我唯一的希望!

But the "NotiScreenSmsReceiver" class never gets called. I've tried several different examples, and I can't for the life of me get the receiver class to get called...I've even tried removing the uses-permission, and I don't even get an error message about not having permissions. What could be wrong? Oh please help me, you're my only hope!

推荐答案

您在手机上使用自定义的短信应用运行此如GOSMS?我听说了一些这些程序将停止广播,以便他们可以创建自己的通知,并停止股票的。

Are you running this on a phone with a custom SMS app such as GOSMS? I've heard that some of those programs will stop the broadcast so that they can create their own notifications and stop the stock ones.

这篇关于Android应用程序没有响应短信接收器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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