If you look at the source of the query() method:
public Cursor query(Query query) { Cursor underlyingCursor = query.runQuery(mResolver, UNDERLYING_COLUMNS, mBaseUri); if (underlyingCursor == null) { return null; } return new CursorTranslator(underlyingCursor, mBaseUri); }
... this may be due to the question of whether it is safe to access cursors in the user interface thread. See Mark Murphy for an excellent answer . Exposure:
So request the DownloadManager in the background thread.
source share