Last active
January 1, 2016 09:59
-
-
Save benigumocom/8129001 to your computer and use it in GitHub Desktop.
ShareActionProvider https://www.youtube.com/watch?v=JApBHLZaNpo#t=335
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
ShareActionProvider | |
android.support.v7.widget.ShareActionProvider | |
*/ | |
@Override | |
public boolean onCreateOptionsMenu(Menu menu) { | |
// Inflate the menu | |
getMenuInflater().inflate(R.menu.main_memu, menu); | |
// Find the share item | |
MenuItem shareItem = menu.findItem(R.id.menu_share); | |
// Rettieve the ShareActionProvider | |
mShareAp = (ShareActionProvider) MenuItemCompat.getActionProvider(shareItem); | |
return super.onCreateOptionsMenu(menu); | |
} | |
//Later when you have create a share intent | |
mShareAp.setShareIntent(shareIntentForContent); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment