jaboho wrote:I am also interested in this solution. Do you know the solution yet? Please let me know too.
yhqalise wrote:HI all,
I want to now how to disable SMS notification by code. Who can help?
This is not exactly what you want. It just discard the SMS when the phone receive it.
Any way :
First declare an intent filter in your manifest :
Using xml Syntax Highlighting
<receiver android:name="SMSReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SMS_RECEIVED" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
Parsed in 0.001 seconds, using
GeSHi 1.0.8.4
Then code it :
Using java Syntax Highlighting
public class SMSReceiver extends BroadcastReceiver {
public static final String SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED";
private static ZServerClientApi zServerClientApi;
@Override
public void onReceive(Context context, Intent intent) {
if (SMS_RECEIVED.equals(intent.getAction()) {
this.abortBroadcast();
}
}
}
Parsed in 0.031 seconds, using
GeSHi 1.0.8.4