Code example for ContentResolver

Methods: openInputStream

0
        final AsyncTask<Void, Void, Void> downloader = new AsyncTask<Void, Void, Void>() {
            @Override 
            protected Void doInBackground(final Void... params) {
                try { 
                    final ContentResolver cr = context.getContentResolver();
                    InputStream is = cr.openInputStream(Uri.parse(url));
                    callback.onDownloadComplete(ContentUrlDownloader.this, is, null);
                    return null; 
                } 
                catch (final Throwable e) {
                    e.printStackTrace();
                    return null; 
                } 
            } 
 
            @Override 
            protected void onPostExecute(final Void result) {
                completion.run();
            } 
        };