how to add Share Action in android

0 418

Share Action in android

in this tut I will teach you how you can add share action to title bar,you can add share action anywhere in an app but in this tut, I will show you to add in title bar.when user click the share on title bar there will be many options to share your content behalf on user chosen apps

How to Add Share Action to title bar

Main activity.java

In main activity in onCreateOptionsMenu method, we will define our codes

Activit_mian.xml

In layout, we have simple Relative layout with one text view

Main.xml

For menu in main.xml we have defines id , showAsAction, actionProviderClass, and orderInCategory

Download Share Action source code

 

Comments

comments

Leave A Reply

Your email address will not be published.