我的应用中有一个 BroadcastReceiver:
public class SMSReceiver extends BroadcastReceiver {
public void onCreate(){
Log.i("APP","SMS Receiver started.");
}
@Override
public void onReceive(Context context, Intent intent) {
Log.i("APP", "SMS received.");
}
}
和接收器:
<receiver class="SMSReceiver" android:name=".SMSReceiver" >
<intent-filter>
<action android:name="smsreceiver" android:value="android.provider.Telephony.SMS_RECEIVED" />
</intent-filter>
</receiver>
和:
<uses-permission android:name="android.permission.RECEIVE_SMS"/>
我开始:
Intent SMS = new Intent(this, SMSReceiver.class);
sendBroadcast(SMS);
在主要活动中。
如何阅读邮件内容?谢谢。