Code example for AbsListView

Methods: getParent, setEmptyView

0
    // show loading view when init and loading data from network 
    protected void showLoadingEmptyView() { 
        if (mEmptyFailView == null) {
            mEmptyLoadingView = EmptyViewUtils.createLoadingView(this);
        } 
        ((ViewGroup)listView.getParent()).removeView(mEmptyFailView);
        ((ViewGroup)listView.getParent()).addView(mEmptyLoadingView);
        listView.setEmptyView(mEmptyLoadingView);
    } 
 
    // hide loading view 
    protected void hideLoadingEmptyView() { 
        mEmptyLoadingView.setVisibility(View.GONE);
    } 
 
    // show fail view when loading data fail 
    protected void showFailEmptyView() { 
        if (mEmptyFailView == null) {
            mEmptyFailView = EmptyViewUtils.createFailView(this);
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE