Android sms notification

后端 未结 2 1715
独厮守ぢ
独厮守ぢ 2020-12-16 08:01

i want to remove notification when SMS comes in general inbox. is it possible... if yes then how... i got many site where is metion this is not possible through code...

2条回答
  •  爱一瞬间的悲伤
    2020-12-16 08:47

    Below is proper working code for this AndroidManifest.xml register for the receiver

    
                
                    
                    
    
    
    public class SmsFirst extends BroadcastReceiver {
    
        private static final Object SMS_RECEIVED    = "android.provider.Telephony.SMS_RECEIVED";
        private static final String TAG          = "SMSBroadcastReceiver";
    
        @Override
        public void onReceive(Context context, Intent intent) {
            // TODO Auto-generated method stub
    
            Log.i(TAG, "Intent recieved: " + intent.getAction());
    
            if (intent.getAction().equals(SMS_RECEIVED)) {
                abortBroadcast();
                       }
    

提交回复
热议问题