Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EditText editText = (EditText) findViewById(R.id.editText);
- String myNum = editText.getText().toString();
- try {
- SmsManager smsManager = SmsManager.getDefault();
- smsManager.sendTextMessage(myNum, null, "Wake Up!", null, null);
- Toast.makeText(getApplicationContext(), "SMS Sent!",
- Toast.LENGTH_LONG).show();
- } catch (Exception e) {
- Toast.makeText(getApplicationContext(),
- "SMS faild, please try again later!",
- Toast.LENGTH_LONG).show();
- e.printStackTrace();
- }
Add Comment
Please, Sign In to add comment