```
 Button clickButton = (Button) findViewById(R.id.newbutton);

        assert clickButton != null;

        clickButton.setOnClickListener(new View.OnClickListener() {

            @Override

            public void onClick(View v) {

    Intent uriIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("whatsapp://send?text=" + "Text you want to share"));

  startActivity(uriIntent);

 }

   });

```