Code example for Fragment

Methods: getActivity, onDestroyView

0
        startSlideshow();    
    } 
 
    @Override 
    public void onDestroyView() { 
        super.onDestroyView(); 
        getActivity().getContentResolver().unregisterContentObserver(mFeedObserver);
    } 
 
    public static String getFeedObjectClause() {
        String[] types = DbObjects.getRenderableTypes();
        StringBuffer allowed = new StringBuffer();
        for (String type : types) {
            allowed.append(",'").append(type).append("'");
        } 
        return DbObject.TYPE + " in (" + allowed.substring(1) + ")";
    } 
 
    private void startSlideshow() { 
        Cursor c = getActivity().getContentResolver().query(mFeedUri, null, getFeedObjectClause(),
                null, DbObject._ID + " ASC");