Android OperationApplicationException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android OperationApplicationException class.

This code example shows how to use the following methods:getMessage, toString
                            ? null : results[0].uri);
        } catch (RemoteException e) {
            Log.e(LOG_TAG, String.format("%s: %s", e.toString(), e.getMessage()));
            return null; 
        } catch (OperationApplicationException e) {
            Log.e(LOG_TAG, String.format("%s: %s", e.toString(), e.getMessage()));
            return null; 
        } 
    } 
 
    /** 
     * Returns the list of created Uris. This list should not be modified by the caller as it is 
     * not a clone. 
     */ 
   public ArrayList<Uri> getCreatedUris() {
        return mCreatedUris;
    } 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
		} catch (RemoteException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (OperationApplicationException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
		return null; 
	} 
 
	public void addToContentResolver(MockContentResolver resolver) {
		resolver.addProvider(DbContract.CONTENT_AUTHORITY, this);
	} 
} 
5
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
		} catch (RemoteException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (OperationApplicationException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} 
 
	} 
	 
	public static boolean isServiceRunning(Context ctx, String serviceName) {
	    ActivityManager manager = (ActivityManager) ctx.getSystemService(Context.ACTIVITY_SERVICE);
	    for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
	        if (serviceName.equals(service.service.getClassName())) {
	            return true; 
	        } 
	    } 
	    return false; 
	} 
} 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
		try { 
			cr.applyBatch("com.nano.forecast", operations);
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (OperationApplicationException e) {
			e.printStackTrace();
		} 
		operations = new ArrayList<ContentProviderOperation>();
	} 
	 
	public Result getForecastNow(Long timeStamp) {
		String[] projection = new String[] {
			    Forecast._ID, 
			    Forecast.COL_LOCAL_TIMESTAMP, 
			    Forecast.COL_MAX_BREAKING_HEIGHT, 
			    Forecast.COL_MIN_BREAKING_HEIGHT, 
			    Forecast.COL_SOLID_RATING,  
			    Forecast.COL_COMBINED_HEIGHT, 
			    Forecast.COL_COMBINED_PERIOD, 
			    Forecast.COL_COMBINED_DIRECTION, 
3
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
					operations);
			return results;
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (OperationApplicationException e) {
			e.printStackTrace();
		} 
		return null; 
	} 
	 
	public void logContentProviderResult(String TAG, ContentProviderResult[] results) {
		for (ContentProviderResult result : results) {
			Log.d(TAG, result.toString());
		} 
	} 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
		try { 
			contactHelper.applyBatch(ContactsContract.AUTHORITY, ops);
		} catch (RemoteException e) {
			e.printStackTrace();
		} catch (OperationApplicationException e) {
			e.printStackTrace();
		} 
	} 
	 
	public static void updateContact(ContentResolver contactHelper,
			String ID, String newNumber) {
 
		ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
		 
		String where = ContactsContract.CommonDataKinds.Phone._ID + "=? AND " + ContactsContract.Data.MIMETYPE + " = ?";
		 
		String[] params = new String[] {ID, ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE};
		 
			ops.add(ContentProviderOperation.newUpdate(ContactsContract.Data.CONTENT_URI)
	                .withSelection(where, params)
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:printStackTrace
				} catch (RemoteException e) {
					// TODO Auto-generated catch block 
					e.printStackTrace();
				} catch (OperationApplicationException e) {
					// TODO Auto-generated catch block 
					e.printStackTrace();
				} 
 
				finish();
 
			} 
		}); 
	} 
 
	public void createContact(String name, String phone)
			throws RemoteException, OperationApplicationException { 
 
		ContentResolver cr = getContentResolver();
 
		ArrayList<ContentProviderOperation> ops = new ArrayList<ContentProviderOperation>();
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:
        String[] selectionArgs = contentProviderOperation.resolveSelectionArgsBackReferences(backRefs, numBackRefs);
        Uri mUri = contentProviderOperation.getUri();
        if (values != null) {
            Uri newUri = insertWithoutLockCheck(sDbHelper, mUri, values, false);
            if (newUri == null) {
                throw new OperationApplicationException("insert failed");
            } 
            return new ContentProviderResult(newUri);
        } 
 
        int numRows = deleteWithoutLockCheck(sDbHelper, mUri, "?", selectionArgs, false);
 
        return new ContentProviderResult(numRows);
    } 
	 
} 
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java
This code example shows how to use the following methods:getMessage, toString
        try { 
            resolver.applyBatch(ContactsContract.AUTHORITY, operationList);
        } catch (RemoteException e) {
            Log.e(LOG_TAG, String.format("%s: %s", e.toString(), e.getMessage()));
        } catch (OperationApplicationException e) {
            Log.e(LOG_TAG, String.format("%s: %s", e.toString(), e.getMessage()));
        } 
    } 
 
    private static class NamePhoneTypePair { 
        final String name;
 
        final int phoneType;
 
        public NamePhoneTypePair(String nameWithPhoneType) {
            // Look for /W /H /M or /O at the end of the name signifying the 
            // type 
            int nameLen = nameWithPhoneType.length();
            if (nameLen - 2 >= 0 && nameWithPhoneType.charAt(nameLen - 2) == '/') {
                char c = Character.toUpperCase(nameWithPhoneType.charAt(nameLen - 1));
4
CodeRank
Connect your IDE to all the code out there  Get Codota for Java

Related Android OperationApplicationException Questions & Answers:

See Code Examples for Android OperationApplicationException Methods: