当前位置: 首页>>代码示例>>Java>>正文


Java ShareActionProvider.setShareHistoryFileName方法代码示例

本文整理汇总了Java中android.widget.ShareActionProvider.setShareHistoryFileName方法的典型用法代码示例。如果您正苦于以下问题:Java ShareActionProvider.setShareHistoryFileName方法的具体用法?Java ShareActionProvider.setShareHistoryFileName怎么用?Java ShareActionProvider.setShareHistoryFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.widget.ShareActionProvider的用法示例。


在下文中一共展示了ShareActionProvider.setShareHistoryFileName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreateActionMode

import android.widget.ShareActionProvider; //导入方法依赖的package包/类
@Override
public boolean onCreateActionMode(ActionMode mode, Menu menu) {
    mode.getMenuInflater().inflate(R.menu.operation, menu);

    mMenu = menu;
    mSharePanoramaMenuItem = menu.findItem(R.id.action_share_panorama);
    if (mSharePanoramaMenuItem != null) {
        mSharePanoramaActionProvider = (ShareActionProvider) mSharePanoramaMenuItem
            .getActionProvider();
        mSharePanoramaActionProvider.setOnShareTargetSelectedListener(
                mShareTargetSelectedListener);
        mSharePanoramaActionProvider.setShareHistoryFileName("panorama_share_history.xml");
    }
    mShareMenuItem = menu.findItem(R.id.action_share);
    if (mShareMenuItem != null) {
        mShareActionProvider = (ShareActionProvider) mShareMenuItem
            .getActionProvider();
        mShareActionProvider.setOnShareTargetSelectedListener(
                mShareTargetSelectedListener);
        mShareActionProvider.setShareHistoryFileName("share_history.xml");
    }
    return true;
}
 
开发者ID:asm-products,项目名称:nexus-gallery,代码行数:24,代码来源:ActionModeHandler.java

示例2: onCreateOptionsMenu

import android.widget.ShareActionProvider; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.content_actions, menu);
    SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
    searchView.setOnQueryTextListener(this);

    // 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.
    Intent shareIntent = new org.bbs.apklauncher.emb.IntentHelper(Intent.ACTION_SEND);
    shareIntent.setType("image/*");
    Uri uri = Uri.fromFile(getFileStreamPath("shared.png"));
    shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
    actionProvider.setShareIntent(shareIntent);
    return true;
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:21,代码来源:SystemUIModes.java

示例3: onCreateOptionsMenu

import android.widget.ShareActionProvider; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate your menu.
    getMenuInflater().inflate(R.menu.action_bar_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());

    // Set file with share history to the provider and set the share intent.
    MenuItem overflowItem = menu.findItem(R.id.menu_item_share_action_provider_overflow);
    ShareActionProvider overflowProvider =
        (ShareActionProvider) overflowItem.getActionProvider();
    overflowProvider.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.
    overflowProvider.setShareIntent(createShareIntent());

    return true;
}
 
开发者ID:luoqii,项目名称:ApkLauncher,代码行数:26,代码来源:ActionBarShareActionProviderActivity.java

示例4: createActionBarMenu

import android.widget.ShareActionProvider; //导入方法依赖的package包/类
public void createActionBarMenu(int menuRes, Menu menu) {
    mActivity.getMenuInflater().inflate(menuRes, menu);
    mActionBarMenu = menu;

    MenuItem item = menu.findItem(R.id.action_share_panorama);
    if (item != null) {
        mSharePanoramaActionProvider = (ShareActionProvider)
            item.getActionProvider();
        mSharePanoramaActionProvider
            .setShareHistoryFileName("panorama_share_history.xml");
        mSharePanoramaActionProvider.setShareIntent(mSharePanoramaIntent);
    }

    item = menu.findItem(R.id.action_share);
    if (item != null) {
        mShareActionProvider = (ShareActionProvider)
            item.getActionProvider();
        mShareActionProvider
            .setShareHistoryFileName("share_history.xml");
        mShareActionProvider.setShareIntent(mShareIntent);
    }
}
 
开发者ID:asm-products,项目名称:nexus-gallery,代码行数:23,代码来源:GalleryActionBar.java

示例5: onCreateOptionsMenu

import android.widget.ShareActionProvider; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    // Inflate the menu items for use in the action bar
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.operations, menu);
    mActionBarMenu = menu;

    // Configure the standard share action provider
    MenuItem item = menu.findItem(R.id.action_share);
    mStandardShareActionProvider = (ShareActionProvider) item.getActionProvider();
    mStandardShareActionProvider.setShareHistoryFileName("standard_share_history.xml");
    if (mStandardShareIntent != null) {
        mStandardShareActionProvider.setShareIntent(mStandardShareIntent);
    }

    // Configure the panorama share action provider
    item = menu.findItem(R.id.action_share_panorama);
    mPanoramaShareActionProvider = (ShareActionProvider) item.getActionProvider();
    mPanoramaShareActionProvider.setShareHistoryFileName("panorama_share_history.xml");
    if (mPanoramaShareIntent != null) {
        mPanoramaShareActionProvider.setShareIntent(mPanoramaShareIntent);
    }

    return super.onCreateOptionsMenu(menu);
}
 
开发者ID:asm-products,项目名称:nexus-camera,代码行数:26,代码来源:CameraActivity.java

示例6: onCreateOptionsMenu

import android.widget.ShareActionProvider; //导入方法依赖的package包/类
@Override
public boolean onCreateOptionsMenu(Menu menu) {
    MenuInflater inflater = getMenuInflater();
    inflater.inflate(R.menu.content_actions, menu);
    SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();
    searchView.setOnQueryTextListener(this);

    // 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.
    Intent shareIntent = new Intent(Intent.ACTION_SEND);
    shareIntent.setType("image/*");
    Uri uri = Uri.fromFile(getFileStreamPath("shared.png"));
    shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
    actionProvider.setShareIntent(shareIntent);
    return true;
}
 
开发者ID:Sherchen,项目名称:ApiDemos,代码行数:21,代码来源:ContentBrowserActivity.java

示例7: onCreateOptionsMenu

import android.widget.ShareActionProvider; //导入方法依赖的package包/类
@Override
public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
    if (BuildConfig.DEBUG) Log.d(getLogTag(), "onCreateOptionsMenu");

    inflater.inflate(R.menu.photoviewer_menu, menu);
    mFavoriteButton = menu.findItem(R.id.menu_favorite);
    mWallpaperButton = menu.findItem(R.id.menu_set_wallpaper);

    /* The task could return before this has inflated, so make sure it's up
     * to date */
    if (mPhotoExtendedInfo != null) {
        updateFavoriteButtonIcon(mPhotoExtendedInfo.isFavorite());
    }

    /* Set file with share history to the provider and set the share
     * intent. */
    MenuItem shareActionItem = menu.findItem(R.id.menu_share);
    ShareActionProvider shareActionProvider =
            (ShareActionProvider) shareActionItem.getActionProvider();
    shareActionProvider.setShareHistoryFileName(
            ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
    shareActionProvider.setShareIntent(createShareIntent());
}
 
开发者ID:brk3,项目名称:glimmr,代码行数:24,代码来源:PhotoViewerFragment.java

示例8: prepareShareActionItem

import android.widget.ShareActionProvider; //导入方法依赖的package包/类
private void prepareShareActionItem(MenuItem shareItem) {
	shareActionProvider = (ShareActionProvider) shareItem.getActionProvider();
	shareActionProvider.setShareHistoryFileName(ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
	shareActionProvider.setOnShareTargetSelectedListener(shareTargetSelectedListener);
	shareActionProvider.setShareIntent(prepareShareIntent(video));
}
 
开发者ID:concentricsky,项目名称:android-viewer-for-khan-academy,代码行数:7,代码来源:VideoDetailActivity.java


注:本文中的android.widget.ShareActionProvider.setShareHistoryFileName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。