Code example for Fragment

Methods: getActivity, getView

0
            return; 
        } 
        mExpandableListShown = shown;
        if (shown) {
            if (animate) {
                mProgressContainer.startAnimation(AnimationUtils.loadAnimation(getActivity(),
                        android.R.anim.fade_out));
                mExpandableListContainer.startAnimation(AnimationUtils.loadAnimation(getActivity(),
                        android.R.anim.fade_in));
            } else { 
                mProgressContainer.clearAnimation();
                mExpandableListContainer.clearAnimation();
            } 
            mProgressContainer.setVisibility(View.GONE);
            mExpandableListContainer.setVisibility(View.VISIBLE);
        } else { 
            if (animate) {
                mProgressContainer.startAnimation(AnimationUtils.loadAnimation(getActivity(),
                        android.R.anim.fade_in));
                mExpandableListContainer.startAnimation(AnimationUtils.loadAnimation(getActivity(),
                        android.R.anim.fade_out));
            } else { 
                mProgressContainer.clearAnimation();
                mExpandableListContainer.clearAnimation();
            } 
            mProgressContainer.setVisibility(View.VISIBLE);
            mExpandableListContainer.setVisibility(View.GONE);
        } 
    } 
 
    /** 
     * Get the ListAdapter associated with this activity's ListView. 
     */ 
    public ExpandableListAdapter getListAdapter() {
        return mAdapter;
    } 
 
    private void ensureList() { 
        if (mExpandableList != null) {
            return; 
        } 
        View root = getView();
        if (root == null) {
            throw new IllegalStateException("Content view not yet created");
        } 
        if (root instanceof ExpandableListView) {
            mExpandableList = (ExpandableListView) root;