Guest User

Untitled

a guest
Mar 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. EditText editText = (EditText) findViewById(R.id.editText);
  2. String myNum = editText.getText().toString();
  3.  
  4.  
  5. try {
  6. SmsManager smsManager = SmsManager.getDefault();
  7. smsManager.sendTextMessage(myNum, null, "Wake Up!", null, null);
  8. Toast.makeText(getApplicationContext(), "SMS Sent!",
  9. Toast.LENGTH_LONG).show();
  10. } catch (Exception e) {
  11. Toast.makeText(getApplicationContext(),
  12. "SMS faild, please try again later!",
  13. Toast.LENGTH_LONG).show();
  14. e.printStackTrace();
  15. }
Add Comment
Please, Sign In to add comment