注册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>
<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>