android.widget.ExpandableListView.setOnCreateContextMenuListener()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.4k)|赞(0)|评价(0)|浏览(134)

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

ExpandableListView.setOnCreateContextMenuListener介绍

暂无

代码示例

代码示例来源:origin: derry/delion

/**
 * Constructor returns an instance of RecentTabsPage.
 *
 * @param activity The activity this view belongs to.
 * @param recentTabsManager The RecentTabsManager which provides the model data.
 */
public RecentTabsPage(Activity activity, RecentTabsManager recentTabsManager) {
  mActivity = activity;
  mRecentTabsManager = recentTabsManager;
  mTitle = activity.getResources().getString(R.string.recent_tabs);
  mThemeColor = ApiCompatibilityUtils.getColor(
      activity.getResources(), R.color.default_primary_color);
  mRecentTabsManager.setUpdatedCallback(this);
  LayoutInflater inflater = LayoutInflater.from(activity);
  mView = (ViewGroup) inflater.inflate(R.layout.recent_tabs_page, null);
  mListView = (ExpandableListView) mView.findViewById(R.id.odp_listview);
  mAdapter = buildAdapter(activity, recentTabsManager);
  mListView.setAdapter(mAdapter);
  mListView.setOnChildClickListener(this);
  mListView.setGroupIndicator(null);
  mListView.setOnGroupCollapseListener(this);
  mListView.setOnGroupExpandListener(this);
  mListView.setOnCreateContextMenuListener(this);
  mView.addOnAttachStateChangeListener(this);
  ApplicationStatus.registerStateListenerForActivity(this, activity);
  // {@link #mInForeground} will be updated once the view is attached to the window.
  onUpdated();
}

代码示例来源:origin: geniusgithub/AndroidDialer

@Override
protected void onCreate(Bundle icicle) {
  super.onCreate(icicle);
  setContentView(R.layout.contact_list_filter_custom);
  mList = (ExpandableListView) findViewById(android.R.id.list);
  mList.setOnChildClickListener(this);
  mList.setHeaderDividersEnabled(true);
  mPrefs = PreferenceManager.getDefaultSharedPreferences(this);
  mAdapter = new DisplayAdapter(this);
  final LayoutInflater inflater = getLayoutInflater();
  findViewById(R.id.btn_done).setOnClickListener(this);
  findViewById(R.id.btn_discard).setOnClickListener(this);
  mList.setOnCreateContextMenuListener(this);
  mList.setAdapter(mAdapter);
  ActionBar actionBar = getActionBar();
  if (actionBar != null) {
    // android.R.id.home will be triggered in onOptionsItemSelected()
    actionBar.setDisplayHomeAsUpEnabled(true);
  }
}

相关文章

ExpandableListView类方法