How to add a Share Button/ Action in Android App
This tutorial explains step by step for how to add a Share Button/ Action in Android Application via Android Studio. Share button will help share our app content.
Please follow the steps below in order to add Share Button/ Action in Android Application:
1.Go to Android studio. Remove “hello world” text and add a Button.
2.Click on the button icon and drag it to the center of the screen.
3.Click on the text tab. Change “Button” to “Share it”.
4.Go to MainActivity.java. Inside the OnClickListener, add an intent to force the application.
5.Change shareBody into shareSub.
6.Go to the live device for the explanation. You can see the button.
7.On pressing the button, you will see a pop-up screen.
8.Copy the screen to the clipboard.
9.Now click on messages.
10. Add recipients and share your subject and description.