how to add Share Action in android

0 503

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


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


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


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

Download Share Action source code




Leave A Reply

Your email address will not be published.