ExpandableListView setSelectedGroup - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for ExpandableListView setSelectedGroup method.

This code example shows how to use the following methods:setSelectedGroup
    /** 
     * Sets the selection to the specified group. 
     * @param groupPosition The position of the group that should be selected. 
     */ 
    public void setSelectedGroup(int groupPosition) {
        mList.setSelectedGroup(groupPosition);
    } 
    public long getSelectedId() { 
        ensureList(); 
        return mList.getSelectedId();
    } 
 
    public ExpandableListView getExpandableListView() {
        ensureList(); 
        return mList;
    } 
 
    /** 
     * The default content for a ListFragment has a TextView that can 
     * be shown when the list is empty.  If you would like to have it 
6
CodeRank
This code example shows how to use the following methods:setAdapter, setOnChildClickListener, setOnGroupClickListener, setOnGroupCollapseListener, setOnGroupExpandListener
     */ 
    public void setListAdapter(final ExpandableListAdapter adapter){
        final boolean hadAdapter = mAdapter != null;
        mAdapter = adapter;
        if(mList != null){
            mList.setAdapter(adapter);
            if(!mListShown && !hadAdapter){
                // The list was hidden, and previously didn't have an 
                // adapter.  It is now time to show it. 
                setListShown(true, getView().getWindowToken() != null);
            } 
        } 
    } 
 
    /** 
     * Sets the selection to the specified group. 
     *  
     * @param groupPosition The position of the group that should be selected. 
     */ 
    public void setSelectedGroup(final int groupPosition){

5
CodeRank
This code example shows how to use the following methods:setSelectedGroup
    /** 
     * Sets the selection to the specified group. 
     * @param groupPosition The position of the group that should be selected. 
     */ 
    public void setSelectedGroup(int groupPosition) {
        mList.setSelectedGroup(groupPosition);
    } 
 
} 
5
CodeRank
This code example shows how to use the following methods:setOnItemClickListener, setSelectedGroup, setEmptyView
        throw new RuntimeException("Content has view with id attribute 'android.R.id.list' "
            + "that is not a ExpandableListView class"); 
      } 
      expandableListView = (ExpandableListView) rawListView;
      if (mEmptyView != null) {
        expandableListView.setEmptyView(mEmptyView);
      } 
    } 
    mListShown = true;
    expandableListView.setOnItemClickListener(mOnClickListener);
    if (mAdapter != null) {
      setListAdapter(mAdapter);
    } else { 
      // We are starting without an adapter, so assume we won't 
      // have our data right away and start with the progress indicator. 
      setListShown(false, false); 
    } 
    mHandler.post(mRequestFocus);
  } 
 

5
CodeRank
This code example shows how to use the following methods:setSelectedGroup
This code example shows how to use the following methods:setSelectedGroup
    /** 
     * Sets the selection to the specified group. 
     * @param groupPosition The position of the group that should be selected. 
     */ 
    public void setSelectedGroup(int groupPosition) {
        mList.setSelectedGroup(groupPosition);
    } 
 
} 
 
4
CodeRank
This code example shows how to use the following methods:setSelectedGroup
    /** 
     * Sets the selection to the specified group. 
     * @param groupPosition The position of the group that should be selected. 
     */ 
    public void setSelectedGroup(int groupPosition) {
        mExpandableList.setSelectedGroup(groupPosition);
    } 
} 
3
CodeRank
This code example shows how to use the following methods:setSelectedGroup
    /** 
     * Sets the selection to the specified group. 
     * @param groupPosition The position of the group that should be selected. 
     */ 
    public void setSelectedGroup(int groupPosition) {
        mExpandableList.setSelectedGroup(groupPosition);
    } 
} 
4
CodeRank
This code example shows how to use the following methods:expandGroup, setSelectedGroup
	/** 点击了Group触发的事件,要根据根据当前点击 Group的状态来判断 */ 
	@Override 
	public boolean onGroupClick(ExpandableListView parent,View v,int groupPosition,long id) {
		if (mAdapter.getGroupClickStatus(groupPosition) == 0) {
			mAdapter.setGroupClickStatus(groupPosition, 1);
			parent.expandGroup(groupPosition);
			parent.setSelectedGroup(groupPosition);
		} else if (mAdapter.getGroupClickStatus(groupPosition) == 1) {
			mAdapter.setGroupClickStatus(groupPosition, 0);
			parent.collapseGroup(groupPosition);
		} 
		return true; 
	} 
	 
	@Override 
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		if (mHeaderView != null) {
			measureChild(mHeaderView, widthMeasureSpec, heightMeasureSpec);
			mHeaderViewWidth = mHeaderView.getMeasuredWidth();
4
CodeRank
This code example shows how to use the following methods:setSelectedGroup
    /** 
     * Sets the selection to the specified group. 
     * @param groupPosition The position of the group that should be selected. 
     */ 
    public void setSelectedGroup(int groupPosition) {
        mList.setSelectedGroup(groupPosition);
    } 
 
} 
 
3
CodeRank

Related ExpandableListView setSelectedGroup Questions & Answers:

setSelectedGroup Method Overview
Sets the selection to the specified group.
See Code Examples for other Android ExpandableListView Methods: