注册SMS接收回调函数实例

来源:互联网 发布:mac化妆刷 编辑:程序博客网 时间:2024/06/02 05:11

注册SMS接收回调函数实例。M5-rc15下调试通过.

请注意AndroidManufest.xml红色部分。

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.anddev.android.smsexample">

    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <application android:icon="@drawable/icon">
        <!-- The Main Activity that gets started by the IntentReceiver listed below -->
        <activity android:name=".SMSActivity" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <!-- This class will react on the SMS show a notification
                        and start the Main-App afterwards -->

        <receiver android:name=".SMSReceiver">
            <intent-filter>
                <action android:name="android.provider.Telephony.SMS_RECEIVED" />
            </intent-filter>
        </receiver>
   
    </application>
</manifest>
原创粉丝点击