Button sms_button = (Button) findViewById(R.id.sms_button);
        sms_button.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

                String number = "";  // The number on which you want to send SMS
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts("sms", number, null)));
            }
        });

        Button email_button = (Button) findViewById(R.id.email_button);
       email_button.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

                String number = "abcd@gmail.com";  // The number on which you want to send SMS
                startActivity(new Intent(Intent.ACTION_VIEW, Uri.fromParts("mailto", number, null)));

            }
        });
    }

© Wklejaj.pl