Code example for Fragment

Methods: getActivity, onDestroyView

0
        onFeedUpdated(); 
    } 
 
    @Override 
    public void onDestroyView() { 
        super.onDestroyView(); 
        getActivity().getContentResolver().unregisterContentObserver(mFeedObserver);
    } 
 
    private void onFeedUpdated() { 
        StringBuilder pathBuilder = new StringBuilder();
        pathBuilder.append("http://maps.googleapis.com/maps/api/staticmap?size=512x512&sensor=true&path=");
        pathBuilder.append("color:0x0000ff|weight:5");
 
        Cursor c = getActivity().getContentResolver().query(mFeedUri, null, getLocationClause(),
                null, DbObject._ID + " DESC"); 
        try { 
	        int totalSize = c.getCount();
	        c.moveToFirst();
	        // TODO: This graphs all points in a path. 
	        // You probably want unique paths for each user.