Code example for AsyncTaskLoader

Methods: getContext

0
 
    public final Object loadInBackground() {
        Uri uri = EsProvider.appendAccountParameter(EsProvider.SQUARES_URI.buildUpon().appendPath(mSquareId), mAccount).build();
        Cursor cursor = null;
        try { 
        	cursor = getContext().getContentResolver().query(uri, PROJECTION, null, null, null);
        	if(null != cursor && cursor.moveToFirst()) {
        		long l = cursor.getLong(1);
        		if(l > 0L) {
        			DbSquareStream adbsquarestream[];
        	        boolean flag2;
        	        if(System.currentTimeMillis() - l > 0xdbba0L)
        	            flag2 = true;
        	        else 
        	            flag2 = false;
        	        mIsDataStale = flag2;
        	        return DbSquareStream.deserialize(cursor.getBlob(0));
        		} 
        	} 
        	DbSquareStream adbsquarestream[] = null;
        	GetViewerSquareOperation getviewersquareoperation = new GetViewerSquareOperation(getContext(), mAccount, mSquareId, null, null);
            getviewersquareoperation.start();
            boolean flag = getviewersquareoperation.hasError();
            if(!flag)
            { 
                Cursor cursor1 = getContext().getContentResolver().query(uri, PROJECTION, null, null, null);
                if(cursor1 != null)
                { 
                    boolean flag1 = cursor1.moveToFirst();
                    adbsquarestream = null;
                    if(flag1)