Search in sources :

Example 1 with ShareActionProvider

use of com.actionbarsherlock.widget.ShareActionProvider in project ActionBarSherlock by JakeWharton.

the class ShareActionProviders method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate your menu.
    getSupportMenuInflater().inflate(R.menu.share_action_provider, menu);
    // Set file with share history to the provider and set the share intent.
    MenuItem actionItem = menu.findItem(R.id.menu_item_share_action_provider_action_bar);
    ShareActionProvider actionProvider = (ShareActionProvider) actionItem.getActionProvider();
    actionProvider.setShareHistoryFileName(ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
    // Note that you can set/change the intent any time,
    // say when the user has selected an image.
    actionProvider.setShareIntent(createShareIntent());
    return true;
}
Also used : MenuItem(com.actionbarsherlock.view.MenuItem) ShareActionProvider(com.actionbarsherlock.widget.ShareActionProvider)

Example 2 with ShareActionProvider

use of com.actionbarsherlock.widget.ShareActionProvider in project musicbrainz-android by jdamcd.

the class ArtistActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    getSupportMenuInflater().inflate(R.menu.artist, menu);
    ShareActionProvider actionProvider = (ShareActionProvider) menu.findItem(R.id.action_share).getActionProvider();
    actionProvider.setShareHistoryFileName(ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
    actionProvider.setShareIntent(Utils.shareIntent(Configuration.ARTIST_SHARE + mbid));
    return true;
}
Also used : ShareActionProvider(com.actionbarsherlock.widget.ShareActionProvider)

Example 3 with ShareActionProvider

use of com.actionbarsherlock.widget.ShareActionProvider in project musicbrainz-android by jdamcd.

the class ReleaseActivity method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    if (App.isUserLoggedIn()) {
        getSupportMenuInflater().inflate(R.menu.release_logged_in, menu);
    } else {
        getSupportMenuInflater().inflate(R.menu.release, menu);
    }
    ShareActionProvider actionProvider = (ShareActionProvider) menu.findItem(R.id.action_share).getActionProvider();
    actionProvider.setShareHistoryFileName(ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
    actionProvider.setShareIntent(Utils.shareIntent(Configuration.RELEASE_SHARE + releaseMbid));
    return true;
}
Also used : ShareActionProvider(com.actionbarsherlock.widget.ShareActionProvider)

Example 4 with ShareActionProvider

use of com.actionbarsherlock.widget.ShareActionProvider in project httpclient by pixmob.

the class ShareActionProviders method onCreateOptionsMenu.

@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate your menu.
    getSupportMenuInflater().inflate(R.menu.share_action_provider, menu);
    // Set file with share history to the provider and set the share intent.
    MenuItem actionItem = menu.findItem(R.id.menu_item_share_action_provider_action_bar);
    ShareActionProvider actionProvider = (ShareActionProvider) actionItem.getActionProvider();
    actionProvider.setShareHistoryFileName(ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
    // Note that you can set/change the intent any time,
    // say when the user has selected an image.
    actionProvider.setShareIntent(createShareIntent());
    return true;
}
Also used : MenuItem(com.actionbarsherlock.view.MenuItem) ShareActionProvider(com.actionbarsherlock.widget.ShareActionProvider)

Aggregations

ShareActionProvider (com.actionbarsherlock.widget.ShareActionProvider)4 MenuItem (com.actionbarsherlock.view.MenuItem)2