Android : ShareActionProvider with dynamic Extras changes

on Monday, September 22, 2014


I've ShareActionProvider in my application and I can share text which I defined in my Intent Extras in my OnCreateOptionsMenu method:



@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.share_menu, menu);
MenuItem item = menu.findItem(R.id.menu_item_share);
myShareActionProvider = (ShareActionProvider) item.getActionProvider();
Intent myIntent = new Intent();
myIntent.setAction(Intent.ACTION_SEND);
myIntent.putExtra(Intent.EXTRA_TEXT, siteUrl);
myIntent.setType("text/plain");
myShareActionProvider.setShareIntent(myIntent);
return true;
}


I have a couple AsyncTask's which change my public static siteUrl

How to change the Extras part of the Intent, when AsyncTask is finished ?


I will be grateful for the help.


0 comments:

Post a Comment