2015-11-05 79 views
0

我想發短信一次。如果已經發送,我想跳過代碼或somthing。只發送短信給未接電話一次Android Eclipse

   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(); 
        } 
       } 

回答

0

@ RAJITHA首先創建shared preferences那麼如果沒有號碼存在共享偏好發送短信之前先檢查每一次..

但請記住共享偏好門店數量,直到你沒有明確或刪除應用程序..所以完成後,您的任務清除保存的沒有偏好..

希望你幫助.. enter link description here