Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 188.8.131.52 release ready!
In this blog,
I will show you how to create a share button in the Action Bar of the MainActivity.
For implementing this we will use ShareActionProvider available in Android.
For creating share action, we have to do two things.
First, we have to need a menu item with property actionProviderClass having the value android.widget.ShareActionProvider.
Second thing is to set a share intent for this menu . This can be done in the callback function onCreateOptions.
Define the android:actionProviderClass attribute for the corresponding <item>
Step 2: Set the Share Intent
Next, call MenuItem.getActionProvider() to retrieve an instance of ShareActionProvider.
You may only need to set the share intent once during the creation of your menus, or you may want to set it and then update it as the UI changes.
Your email address will not be published. Required fields are marked*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
Webkul is a truly trusted and supported IT Company to develop business ideas for e-commerce. They provide professional support after deploying the solution to production and be responsible to act for fixing the reported issues or system errors. We highly encourage to deal with Webkul for business development.
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.