advancedSmsManager icon indicating copy to clipboard operation
advancedSmsManager copied to clipboard

NullPointerException occurs anywhere the following code is used

Open azizur-rehman opened this issue 6 years ago • 0 comments

            SmsHandler.builder(context, "+989120000000")
            .withCarrierNameFilter("MCI")
            .withCustomDialogForSendSms(R.layout.my_sms_dialog)
            .withCustomDialogForChoseSim(R.layout.simcard_choosing_dialog)
            .needToShowSendSmsDialog(false)
            //Here is the logcat pointing
          .build().sendSms(DIALOG_MESSAGE, SMS_BODY, new MySmsManager.SMSManagerCallBack() {
        @Override
        public void afterSuccessfulSMS(int smsId) {

        }

        @Override
        public void afterDelivered(int smsId) {

        }

        @Override
        public void afterUnSuccessfulSMS(int smsId, String message) {

        }

        @Override
        public void onCarrierNameNotMatch(int smsId, String message) {

        }
    });

Here is the stacktrace

   java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Resources 
   android.content.Context.getResources()' on a null object reference
    

azizur-rehman avatar Aug 08 '18 07:08 azizur-rehman