android.view.MenuItem.setActionProvider()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(80)

本文整理了Java中android.view.MenuItem.setActionProvider()方法的一些代码示例,展示了MenuItem.setActionProvider()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。MenuItem.setActionProvider()方法的具体详情如下:
包路径:android.view.MenuItem
类名称:MenuItem
方法名:setActionProvider

暂无

代码示例

代码示例来源:origin: robolectric/robolectric

item = item.setOnMenuItemClickListener(null);
assertThat(item).isNotNull();
item = item.setActionProvider(null);
assertThat(item).isNotNull();
item = item.setActionView(0);

代码示例来源:origin: com.actionbarsherlock/actionbarsherlock

@Override
public MenuItem setActionProvider(ActionProvider actionProvider) {
  mNativeItem.setActionProvider(new ActionProviderWrapper(actionProvider));
  return this;
}

代码示例来源:origin: com.willowtreeapps/oak-demos

@Override
public MenuItem setActionProvider(ActionProvider actionProvider) {
  mNativeItem.setActionProvider(new ActionProviderWrapper(actionProvider));
  return this;
}

代码示例来源:origin: kingargyle/adt-leanback-support

public static void configureMenuItem(MenuItem item, Activity callingActivity, Intent intent) {
    ActionProvider itemProvider = item.getActionProvider();
    ShareActionProvider provider = null;
    if (!(itemProvider instanceof ShareActionProvider)) {
      provider = new ShareActionProvider(callingActivity);
    } else {
      provider = (ShareActionProvider) itemProvider;
    }
    provider.setShareHistoryFileName(HISTORY_FILENAME_PREFIX +
        callingActivity.getClass().getName());
    provider.setShareIntent(intent);
    item.setActionProvider(provider);
  }
}

代码示例来源:origin: com.google.android/support-v4

public static void configureMenuItem(MenuItem item, Activity callingActivity, Intent intent) {
    ActionProvider itemProvider = item.getActionProvider();
    ShareActionProvider provider = null;
    if (!(itemProvider instanceof ShareActionProvider)) {
      provider = new ShareActionProvider(callingActivity);
    } else {
      provider = (ShareActionProvider) itemProvider;
    }
    provider.setShareHistoryFileName(HISTORY_FILENAME_PREFIX +
        callingActivity.getClass().getName());
    provider.setShareIntent(intent);
    item.setActionProvider(provider);
  }
}

相关文章