Code example for Uri

Methods: buildUpon

0
 
    private void deleteFromSim(Cursor cursor) {
        String messageIndexString =
                cursor.getString(cursor.getColumnIndexOrThrow("index_on_icc"));
        Uri simUri = ICC_URI.buildUpon().appendPath(messageIndexString).build();
 
        SqliteWrapper.delete(this, mContentResolver, simUri, null, null);
    } 
 
    private void deleteAllFromSim() { 
        Cursor cursor = (Cursor) mListAdapter.getCursor();
 
        if (cursor != null) {
            if (cursor.moveToFirst()) {
                int count = cursor.getCount();
 
                for (int i = 0; i < count; ++i) {
                    deleteFromSim(cursor);
                    cursor.moveToNext();
                } 
            }