Best code examples for Android DownloadManager.Query class (android.app.DownloadManager.Query)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android DownloadManager.Query class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Android DownloadManager.Query examples from Open Source projects
This code example shows how to use the following methods: setFilterById
    private int getDownloadFailureReason(long id) {
        return getDownloadQueryAsInt(id, DownloadManager.COLUMN_REASON);
    } 
 
    private int getDownloadQueryAsInt(long id, String column) {
        Query query = new Query();
        query.setFilterById(id);
 
        Cursor c = downloadManager.query(query);
        if (!c.moveToFirst()) {
            return -1; 
        } 
 
        int columnIndex = c.getColumnIndex(column);
        return c.getInt(columnIndex);
    } 
 
    public interface DownloadCallback { 
        void onStart(String path);
        void onCancel(); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setFilterById, setFilterByStatus
This code example shows how to use the following methods: setFilterById, setFilterByStatus
			return; 
		} 
		 
		DownloadManager dm = (DownloadManager) ctx.getSystemService(Context.DOWNLOAD_SERVICE);
	 
		Query query = new Query();
		query.setFilterById( downloadKey );
		query.setFilterByStatus( DownloadManager.STATUS_SUCCESSFUL );
		 
		Cursor cursor = dm.query(query);
		 
		if ( cursor.moveToNext() ){
			Log.d(TAG, "Clicked download successful completed.");
		}else{ 
			Log.d(TAG, "clicking on a download that is not complete. Just let us have patience ...");
		}				 
	} 
} 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setFilterById, setFilterByStatus
			return; 
		} 
		 
		DownloadManager dm = (DownloadManager) context.getSystemService( Context.DOWNLOAD_SERVICE );
		 
		Query query = new Query();
		query.setFilterById(downloadKey);
		query.setFilterByStatus( DownloadManager.STATUS_SUCCESSFUL );
 		 
		Cursor cursor = dm.query(query);		
  
		if ( cursor.moveToFirst() ){
	  
			DownloadDao downloadDao = new DownloadDao(context);
			ArticleDownloaded articleDownloaded = downloadDao.getById( downloadKey );
			if ( articleDownloaded == null ){
				return; 
			} 
 
			articleDownloaded = populeArticleDownloadedFromCursor(articleDownloaded, cursor);
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: setFilterById, setFilterByStatus
			return; 
		} 
		 
		DownloadManager dm = (DownloadManager) context.getSystemService( Context.DOWNLOAD_SERVICE );
		 
		Query query = new Query();
		query.setFilterById(downloadKey);
		query.setFilterByStatus( DownloadManager.STATUS_SUCCESSFUL );
 		 
		Cursor cursor = dm.query(query);		
  
		if ( cursor.moveToFirst() ){
	  
			DownloadDao downloadDao = new DownloadDao(context);
			ArticleDownloaded articleDownloaded = downloadDao.getById( downloadKey );
			if ( articleDownloaded == null ){
				return; 
			} 
 
			articleDownloaded = populeArticleDownloadedFromCursor(articleDownloaded, cursor);
Full Snippet Info
5
CodeRank
Related Android DownloadManager.Query Questions & Answers:
See Code Examples for Android DownloadManager.Query Methods: