Code example for Fragment

Methods: onViewCreated

0
    /** 
     * Attach to grid view once the view hierarchy has been created. 
     */ 
    @Override 
    public void onViewCreated(View view, Bundle savedInstanceState) {
        super.onViewCreated(view, savedInstanceState);
        ensureList(); 
    } 
 
    /** 
     * Detach from grid view. 
     */ 
    @Override 
    public void onDestroyView() { 
        mHandler.removeCallbacks(mRequestFocus);
        mGridView = null;
        mGridShown = false;
        mEmptyView = mProgressContainer = mGridContainer = null;
        mStandardEmptyView = null;
        super.onDestroyView(); 
    }