【问题标题】:Send SMS for Missed Calls only once Android Eclipse只为未接来电发送一次短信 Android Eclipse
【发布时间】:2015-11-05 08:39:45
【问题描述】:

我想发送一次短信。如果已经发送,我想跳过代码或其他内容。

             Log.i("Send SMS", "");
             String phoneNo = incomingNumber;
             String newN = incomingNumber;
              if (newN!=oldN)
                {
                SmsManager smsManager = SmsManager.getDefault();
                    String message = "im on a meeting call you later -ExAutoSmS-";
                try {
                 smsManager.sendTextMessage(phoneNo, null, message, null, null);
                 oldN = incomingNumber;

                    } catch (Exception e) {
                        e.printStackTrace();
                    } 
                }

【问题讨论】:

    标签: android eclipse sms phone-call


    【解决方案1】:

    @RAJITHA 首先创建shared preferences,然后每次发送短信前检查共享偏好中是否不存在号码..

    但请记住共享的偏好商店编号,直到您没有清除或删除应用程序..所以在完成任务后清除偏好中保存的编号..

    希望你能帮上忙..enter link description here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多