1
내 앱에서 SMS를 받고 싶지만 안드로이드가 해당 이벤트에 대한 알림을 표시하는 것을 원하지 않습니다.알림없이 SMS 수신 4.4.2
은 내가
<receiver android:name="mypackage.SMSReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED"/>
</intent-filter>
</receiver>
<uses-permission android:name="android.permission.RECEIVE_SMS" />
작성된 코드
public class SMSReceiver extends BroadcastReceiver
{
@Override
public void onReceive(Context context, Intent intent)
{
Bundle extras = intent.getExtras();
Object[] pdus = (Object[])extras.get("pdus");
for (Object pdu: pdus)
{
SmsMessage msg = SmsMessage.createFromPdu((byte[])pdu);
String origin = msg.getOriginatingAddress();
String body = msg.getMessageBody();
// Parse the SMS body
if (isMySpecialSMS)
{
// Stop it being passed to the main Messaging inbox
abortBroadcast();
}
}
}
}
선언하고 설정 우선 순위를
<intent-filter android:priority="100">
을 시도하지만 작동하지! 전화 표시 통지를했다!
은이 안드로이드 4.4.2 (API 19) (삼성 주 3) 킷캣 (4.4) 기본 응용 프로그램이기 때문에, 앱, 알림을 억제하기 위해 기본 SMS 앱 될 필요가 시작