Code example for ContentResolver

Methods: applyBatch

     * given {@link ContentResolver}. 
    public void parseAndApply(XmlPullParser parser, ContentResolver resolver)
            throws HandlerException { 
        try { 
            final ArrayList<ContentProviderOperation> batch = parse(parser, resolver);
            resolver.applyBatch(mAuthority, batch);
        } catch (HandlerException e) {
            throw e;
        } catch (XmlPullParserException e) {
            throw new HandlerException("Problem parsing XML response", e);
        } catch (IOException e) {
            throw new HandlerException("Problem reading response", e);
        } catch (RemoteException e) {
            // Failed binder transactions aren't recoverable 
            throw new RuntimeException("Problem applying batch operation", e);
        } catch (OperationApplicationException e) {
            // Failures like constraint violation aren't recoverable 
            // TODO: write unit tests to exercise full provider 
Connect your IDE to all the code out there  Get Codota for Java