當前位置: 首頁>>代碼示例>>Java>>正文


Java OpenableColumns.DISPLAY_NAME屬性代碼示例

本文整理匯總了Java中android.provider.OpenableColumns.DISPLAY_NAME屬性的典型用法代碼示例。如果您正苦於以下問題:Java OpenableColumns.DISPLAY_NAME屬性的具體用法?Java OpenableColumns.DISPLAY_NAME怎麽用?Java OpenableColumns.DISPLAY_NAME使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.provider.OpenableColumns的用法示例。


在下文中一共展示了OpenableColumns.DISPLAY_NAME屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getFileDisplayNameFromUri

private static String getFileDisplayNameFromUri(Context context, Uri uri) {
    String scheme = uri.getScheme();

    if (ContentResolver.SCHEME_FILE.equals(scheme)) {
        return uri.getLastPathSegment();
    } else if (ContentResolver.SCHEME_CONTENT.equals(scheme)) {

        String[] projection = {OpenableColumns.DISPLAY_NAME};

        Cursor cursor = null;
        try {
            cursor = context.getContentResolver().query(uri, projection, null, null, null);
            if (cursor != null && cursor.moveToFirst()) {
                return cursor.getString(cursor.getColumnIndex(OpenableColumns.DISPLAY_NAME));
            }
        } finally {
            if (cursor != null) {
                cursor.close();
            }
        }
    }

    // This will only happen if the Uri isn't either SCHEME_CONTENT or SCHEME_FILE, so we assume
    // it already represents the file's name.
    return uri.toString();
}
 
開發者ID:Gericop,項目名稱:Android-Support-Preference-V7-Fix,代碼行數:26,代碼來源:RingtonePreferenceDialogFragmentCompat.java

示例2: query

@Override
public Cursor query(Uri uri, String[] projection, String selection,
					String[] selectionArgs, String sortOrder) {
	if (1 == uriMatcher.match(uri)) {
		MatrixCursor cursor = null;
		File file = new File(getContext().getCacheDir() + File.separator
				+ DSCApplication.LOGS_FOLDER_NAME + File.separator
				+ uri.getLastPathSegment());
		if (file.exists()) {
			cursor = new MatrixCursor(new String[]{
					OpenableColumns.DISPLAY_NAME, OpenableColumns.SIZE});
			cursor.addRow(new Object[]{uri.getLastPathSegment(),
					file.length()});
		}
		return cursor;
	}
	return null;
}
 
開發者ID:ciubex,項目名稱:dscautorename,代碼行數:18,代碼來源:CachedFileProvider.java

示例3: query

/**
 * Use a content URI returned by
 * {@link #getUriForFile(Context, String, File) getUriForFile()} to get information about a file
 * managed by the FileProvider.
 * FileProvider reports the column names defined in {@link android.provider.OpenableColumns}:
 * <ul>
 * <li>{@link android.provider.OpenableColumns#DISPLAY_NAME}</li>
 * <li>{@link android.provider.OpenableColumns#SIZE}</li>
 * </ul>
 * For more information, see
 * {@link ContentProvider#query(Uri, String[], String, String[], String)
 * ContentProvider.query()}.
 *
 * @param uri           A content URI returned by {@link #getUriForFile}.
 * @param projection    The list of columns to put into the {@link Cursor}. If null all columns are
 *                      included.
 * @param selection     Selection criteria to apply. If null then all data that matches the content
 *                      URI is returned.
 * @param selectionArgs An array of {@link java.lang.String}, containing arguments to bind to
 *                      the <i>selection</i> parameter. The <i>query</i> method scans <i>selection</i> from left to
 *                      right and iterates through <i>selectionArgs</i>, replacing the current "?" character in
 *                      <i>selection</i> with the value at the current position in <i>selectionArgs</i>. The
 *                      values are bound to <i>selection</i> as {@link java.lang.String} values.
 * @param sortOrder     A {@link java.lang.String} containing the column name(s) on which to sort
 *                      the resulting {@link Cursor}.
 * @return A {@link Cursor} containing the results of the query.
 */
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
                    String sortOrder) {
    // ContentProvider has already checked granted permissions
    final File file = mStrategy.getFileForUri(uri);

    if (projection == null) {
        projection = COLUMNS;
    }

    String[] cols = new String[projection.length];
    Object[] values = new Object[projection.length];
    int i = 0;
    for (String col : projection) {
        if (OpenableColumns.DISPLAY_NAME.equals(col)) {
            cols[i] = OpenableColumns.DISPLAY_NAME;
            values[i++] = file.getName();
        } else if (OpenableColumns.SIZE.equals(col)) {
            cols[i] = OpenableColumns.SIZE;
            values[i++] = file.length();
        }
    }

    cols = copyOf(cols, i);
    values = copyOf(values, i);

    final MatrixCursor cursor = new MatrixCursor(cols, 1);
    cursor.addRow(values);
    return cursor;
}
 
開發者ID:roshakorost,項目名稱:Phial,代碼行數:57,代碼來源:FileProvider.java

示例4: query

/**
 * Use a content URI returned by
 * {@link #getUriForFile(Context, String, File) getUriForFile()} to get information about a file
 * managed by the FileProvider.
 * FileProvider reports the column names defined in {@link android.provider.OpenableColumns}:
 * <ul>
 * <li>{@link android.provider.OpenableColumns#DISPLAY_NAME}</li>
 * <li>{@link android.provider.OpenableColumns#SIZE}</li>
 * </ul>
 * For more information, see
 * {@link ContentProvider#query(Uri, String[], String, String[], String)
 * ContentProvider.query()}.
 *
 * @param uri A content URI returned by {@link #getUriForFile}.
 * @param projection The list of columns to put into the {@link Cursor}. If null all columns are
 * included.
 * @param selection Selection criteria to apply. If null then all data that matches the content
 * URI is returned.
 * @param selectionArgs An array of {@link java.lang.String}, containing arguments to bind to
 * the <i>selection</i> parameter. The <i>query</i> method scans <i>selection</i> from left to
 * right and iterates through <i>selectionArgs</i>, replacing the current "?" character in
 * <i>selection</i> with the value at the current position in <i>selectionArgs</i>. The
 * values are bound to <i>selection</i> as {@link java.lang.String} values.
 * @param sortOrder A {@link java.lang.String} containing the column name(s) on which to sort
 * the resulting {@link Cursor}.
 * @return A {@link Cursor} containing the results of the query.
 *
 */
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
        String sortOrder) {
    // ContentProvider has already checked granted permissions
    final File file = mStrategy.getFileForUri(uri);

    if (projection == null) {
        projection = COLUMNS;
    }

    String[] cols = new String[projection.length];
    Object[] values = new Object[projection.length];
    int i = 0;
    for (String col : projection) {
        if (OpenableColumns.DISPLAY_NAME.equals(col)) {
            cols[i] = OpenableColumns.DISPLAY_NAME;
            values[i++] = file.getName();
        } else if (OpenableColumns.SIZE.equals(col)) {
            cols[i] = OpenableColumns.SIZE;
            values[i++] = file.length();
        }
    }

    cols = copyOf(cols, i);
    values = copyOf(values, i);

    final MatrixCursor cursor = new MatrixCursor(cols, 1);
    cursor.addRow(values);
    return cursor;
}
 
開發者ID:GigigoGreenLabs,項目名稱:permissionsModule,代碼行數:58,代碼來源:FileProvider.java

示例5: query

/**
 * Use a content URI returned by
 * {@link #getUriForFile(Context, String, File) getUriForFile()} to get information about a file
 * managed by the PublicFileProvider.
 * PublicFileProvider reports the column names defined in {@link android.provider.OpenableColumns}:
 * <ul>
 * <li>{@link android.provider.OpenableColumns#DISPLAY_NAME}</li>
 * <li>{@link android.provider.OpenableColumns#SIZE}</li>
 * </ul>
 * For more information, see
 * {@link ContentProvider#query(Uri, String[], String, String[], String)
 * ContentProvider.query()}.
 *
 * @param uri A content URI returned by {@link #getUriForFile}.
 * @param projection The list of columns to put into the {@link Cursor}. If null all columns are
 * included.
 * @param selection Selection criteria to apply. If null then all data that matches the content
 * URI is returned.
 * @param selectionArgs An array of {@link java.lang.String}, containing arguments to bind to
 * the <i>selection</i> parameter. The <i>query</i> method scans <i>selection</i> from left to
 * right and iterates through <i>selectionArgs</i>, replacing the current "?" character in
 * <i>selection</i> with the value at the current position in <i>selectionArgs</i>. The
 * values are bound to <i>selection</i> as {@link java.lang.String} values.
 * @param sortOrder A {@link java.lang.String} containing the column name(s) on which to sort
 * the resulting {@link Cursor}.
 * @return A {@link Cursor} containing the results of the query.
 *
 */
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
    File file = strategy.getFileForUri(uri);

    if (projection == null) {
        projection = COLUMNS;
    }

    String[] columns = new String[projection.length];
    Object[] values = new Object[projection.length];
    int i = 0;
    for (String column : projection) {
        if (OpenableColumns.DISPLAY_NAME.equals(column)) {
            columns[i] = OpenableColumns.DISPLAY_NAME;
            values[i++] = file.getName();
        } else if (OpenableColumns.SIZE.equals(column)) {
            columns[i] = OpenableColumns.SIZE;
            values[i++] = file.length();
        }
    }

    columns = copyOf(columns, i);
    values = copyOf(values, i);

    MatrixCursor cursor = new MatrixCursor(columns, 1);
    cursor.addRow(values);
    return cursor;
}
 
開發者ID:cketti,項目名稱:PublicFileProvider,代碼行數:56,代碼來源:PublicFileProvider.java

示例6: query

/**
 * Use a content URI returned by
 * {@link #getUriForFile(Context, String, File) getUriForFile()} to get information about a file
 * managed by the FileProvider.
 * FileProvider reports the column names defined in {@link OpenableColumns}:
 * <ul>
 * <li>{@link OpenableColumns#DISPLAY_NAME}</li>
 * <li>{@link OpenableColumns#SIZE}</li>
 * </ul>
 * For more information, see
 * {@link ContentProvider#query(Uri, String[], String, String[], String)
 * ContentProvider.query()}.
 *
 * @param uri           A content URI returned by {@link #getUriForFile}.
 * @param projection    The list of columns to put into the {@link Cursor}. If null all columns are
 *                      included.
 * @param selection     Selection criteria to apply. If null then all data that matches the content
 *                      URI is returned.
 * @param selectionArgs An array of {@link String}, containing arguments to bind to
 *                      the <i>selection</i> parameter. The <i>query</i> method scans <i>selection</i> from left to
 *                      right and iterates through <i>selectionArgs</i>, replacing the current "?" character in
 *                      <i>selection</i> with the value at the current position in <i>selectionArgs</i>. The
 *                      values are bound to <i>selection</i> as {@link String} values.
 * @param sortOrder     A {@link String} containing the column name(s) on which to sort
 *                      the resulting {@link Cursor}.
 *
 * @return A {@link Cursor} containing the results of the query.
 */
@Override
public Cursor query(@NotNull Uri uri, @Nullable String[] projection, @Nullable String selection,
                    @Nullable String[] selectionArgs,
                    @Nullable String sortOrder) {
    // ContentProvider has already checked granted permissions
    final File file = mStrategy.getFileForUri(uri);

    if (projection == null) {
        projection = COLUMNS;
    }

    String[] cols = new String[projection.length];
    Object[] values = new Object[projection.length];
    int i = 0;
    for (String col : projection) {
        if (OpenableColumns.DISPLAY_NAME.equals(col)) {
            cols[i] = OpenableColumns.DISPLAY_NAME;
            values[i++] = file.getName();
        } else if (OpenableColumns.SIZE.equals(col)) {
            cols[i] = OpenableColumns.SIZE;
            values[i++] = file.length();
        }
    }

    cols = copyOf(cols, i);
    values = copyOf(values, i);

    final MatrixCursor cursor = new MatrixCursor(cols, 1);
    cursor.addRow(values);
    return cursor;
}
 
開發者ID:StepicOrg,項目名稱:stepik-android,代碼行數:59,代碼來源:GenericFileProvider.java

示例7: query

@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
    String uriPath = uri.getLastPathSegment();
    if (uriPath == null) {
        return null;
    }
    if (projection == null) {
        projection = new String[] {
                BaseColumns._ID,
                MediaStore.MediaColumns.DATA,
                OpenableColumns.DISPLAY_NAME,
                OpenableColumns.SIZE
        };
    }
    // If we receive a query on display name or size,
    // we should block until the image is ready
    mImageReadyCond.block();

    File path = new File(uriPath);

    MatrixCursor cursor = new MatrixCursor(projection);
    Object[] columns = new Object[projection.length];
    for (int i = 0; i < projection.length; i++) {
        if (projection[i].equalsIgnoreCase(BaseColumns._ID)) {
            columns[i] = 0;
        } else if (projection[i].equalsIgnoreCase(MediaStore.MediaColumns.DATA)) {
            columns[i] = uri;
        } else if (projection[i].equalsIgnoreCase(OpenableColumns.DISPLAY_NAME)) {
            columns[i] = path.getName();
        } else if (projection[i].equalsIgnoreCase(OpenableColumns.SIZE)) {
            columns[i] = path.length();
        }
    }
    cursor.addRow(columns);

    return cursor;
}
 
開發者ID:asm-products,項目名稱:nexus-gallery,代碼行數:37,代碼來源:SharedImageProvider.java

示例8: query

/**
 * Use a content URI returned by
 * {@link #getUriForFile(Context, File) getUriForFile()} to get information about a file
 * managed by the FileProvider.
 * FileProvider reports the column names defined in {@link android.provider.OpenableColumns}:
 * <ul>
 * <li>{@link android.provider.OpenableColumns#DISPLAY_NAME}</li>
 * <li>{@link android.provider.OpenableColumns#SIZE}</li>
 * </ul>
 * For more information, see
 * {@link ContentProvider#query(Uri, String[], String, String[], String)
 * ContentProvider.query()}.
 *
 * @param uri           A content URI returned by {@link #getUriForFile}.
 * @param projection    The list of columns to put into the {@link Cursor}. If null all columns are
 *                      included.
 * @param selection     Selection criteria to apply. If null then all data that matches the content
 *                      URI is returned.
 * @param selectionArgs An array of {@link java.lang.String}, containing arguments to bind to
 *                      the <i>selection</i> parameter. The <i>query</i> method scans <i>selection</i> from left to
 *                      right and iterates through <i>selectionArgs</i>, replacing the current "?" character in
 *                      <i>selection</i> with the value at the current position in <i>selectionArgs</i>. The
 *                      values are bound to <i>selection</i> as {@link java.lang.String} values.
 * @param sortOrder     A {@link java.lang.String} containing the column name(s) on which to sort
 *                      the resulting {@link Cursor}.
 * @return A {@link Cursor} containing the results of the query.
 */
@Override
public Cursor query(@NonNull Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
    // ContentProvider has already checked granted permissions
    final File file = mStrategy.getFileForUri(uri);

    if (projection == null) {
        projection = COLUMNS;
    }

    String[] cols = new String[projection.length];
    Object[] values = new Object[projection.length];
    int i = 0;
    for (String col : projection) {
        if (OpenableColumns.DISPLAY_NAME.equals(col)) {
            cols[i] = OpenableColumns.DISPLAY_NAME;
            values[i++] = file.getName();
        } else if (OpenableColumns.SIZE.equals(col)) {
            cols[i] = OpenableColumns.SIZE;
            values[i++] = file.length();
        } else if (COLUMN_LAST_MODIFIED.equals(col)) {
            cols[i] = COLUMN_LAST_MODIFIED;
            values[i++] = file.lastModified();
        }
    }

    cols = copyOf(cols, i);
    values = copyOf(values, i);

    final MatrixCursor cursor = new MatrixCursor(cols, 1);
    cursor.addRow(values);
    return cursor;
}
 
開發者ID:andreynovikov,項目名稱:trekarta,代碼行數:59,代碼來源:ExportProvider.java

示例9: onCreateLoader

@Override
public Loader<Cursor> onCreateLoader(int id, Bundle args) {
    final FragmentActivity fa = (FragmentActivity) GeckoAppShell.getGeckoInterface().getActivity();
    return new CursorLoader(fa,
                            uri,
                            new String[] { OpenableColumns.DISPLAY_NAME },
                            null,  // selection
                            null,  // selectionArgs
                            null); // sortOrder
}
 
開發者ID:jrconlin,項目名稱:mc_backup,代碼行數:10,代碼來源:FilePickerResultHandler.java

示例10: query

@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
        String sortOrder) {
    // ContentProvider has already checked granted permissions
    final File file = mStrategy.getFileForUri(uri);

    if (projection == null) {
        projection = COLUMNS;
    }

    String[] cols = new String[projection.length];
    Object[] values = new Object[projection.length];
    int i = 0;
    for (String col : projection) {
        if (OpenableColumns.DISPLAY_NAME.equals(col)) {
            cols[i] = OpenableColumns.DISPLAY_NAME;
            values[i++] = file.getName();
        } else if (OpenableColumns.SIZE.equals(col)) {
            cols[i] = OpenableColumns.SIZE;
            values[i++] = file.length();
        }
    }

    cols = copyOf(cols, i);
    values = copyOf(values, i);

    final MatrixCursor cursor = new MatrixCursor(cols, 1);
    cursor.addRow(values);
    return cursor;
}
 
開發者ID:codenameone,項目名稱:CodenameOne,代碼行數:30,代碼來源:FileProvider.java

示例11: query

@Nullable
@Override
public Cursor query(@NonNull Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
	if (projection == null) {
		projection = COLUMNS;
	}
	String[] cols = new String[projection.length];
	Object[] values = new Object[projection.length];
	int i = 0;
	for (String col : projection) {
		if (OpenableColumns.DISPLAY_NAME.equals(col)) {
			cols[i] = OpenableColumns.DISPLAY_NAME;
			values[i++] = getContext().getString(R.string.export_bookmarks_file_name, DatabaseManager.getInstance().getYear());
		} else if (OpenableColumns.SIZE.equals(col)) {
			cols[i] = OpenableColumns.SIZE;
			// Unknown size, content will be generated on-the-fly
			values[i++] = 1024L;
		}
	}

	cols = copyOf(cols, i);
	values = copyOf(values, i);

	final MatrixCursor cursor = new MatrixCursor(cols, 1);
	cursor.addRow(values);
	return cursor;
}
 
開發者ID:cbeyls,項目名稱:fosdem-companion-android,代碼行數:27,代碼來源:BookmarksExportProvider.java

示例12: query

@Nullable
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
    // Code from FileProvider
    File file = new File(uri.getPath());
    if (projection == null) {
        projection = COLUMNS;
    }

    String[] cols = new String[projection.length];
    Object[] values = new Object[projection.length];

    int i = 0;
    for (String col : projection) {
        if (OpenableColumns.DISPLAY_NAME.equals(col)) {
            cols[i] = OpenableColumns.DISPLAY_NAME;
            values[i++] = file.getName();
        } else if (OpenableColumns.SIZE.equals(col)) {
            cols[i] = OpenableColumns.SIZE;
            values[i++] = file.length();
        }
    }

    cols = copyOf(cols, i);
    values = copyOf(values, i);

    final MatrixCursor cursor = new MatrixCursor(cols, 1);
    cursor.addRow(values);
    return cursor;
}
 
開發者ID:infinum,項目名稱:android_dbinspector,代碼行數:30,代碼來源:DatabaseProvider.java

示例13: query

@Override
public Cursor query(@NonNull Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
    // Security
    verifyCaller();

    // content providers that support open and openAssetFile should support queries for all
    // android.provider.OpenableColumns.
    int displayNameIndex = -1;
    int sizeIndex = -1;
    // If projection is null, return all columns.
    if (projection == null) {
        projection = new String[]{OpenableColumns.DISPLAY_NAME, OpenableColumns.SIZE};
    }
    for (int i = 0; i < projection.length; i++) {
        if (OpenableColumns.DISPLAY_NAME.equals(projection[i])) {
            displayNameIndex = i;
        }
        if (OpenableColumns.SIZE.equals(projection[i])) {
            sizeIndex = i;
        }
    }
    MatrixCursor cursor = new MatrixCursor(projection);
    Object[] result = new Object[projection.length];
    for (int i = 0; i < result.length; i++) {
        if (i == displayNameIndex) {
            result[i] = uri.getPath();
        }
        if (i == sizeIndex) {
            result[i] = null; // Size is unknown, so null, if it was known, it would go here.
        }
    }
    cursor.addRow(result);
    return cursor;
}
 
開發者ID:Xlythe,項目名稱:ThemeEngine,代碼行數:34,代碼來源:FileProvider.java

示例14: query

@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
                    String sortOrder) {
    // ContentProvider has already checked granted permissions
    final File file = mStrategy.getFileForUri(uri);

    if (projection == null) {
        projection = COLUMNS;
    }

    String[] cols = new String[projection.length];
    Object[] values = new Object[projection.length];
    int i = 0;
    for (String col : projection) {
        if (OpenableColumns.DISPLAY_NAME.equals(col)) {
            cols[i] = OpenableColumns.DISPLAY_NAME;
            values[i++] = file.getName();
        } else if (OpenableColumns.SIZE.equals(col)) {
            cols[i] = OpenableColumns.SIZE;
            values[i++] = file.length();
        }
    }

    cols = copyOf(cols, i);
    values = copyOf(values, i);

    final MatrixCursor cursor = new MatrixCursor(cols, 1);
    cursor.addRow(values);
    return cursor;
}
 
開發者ID:SecrecySupportTeam,項目名稱:Secrecy_fDroid_DEPRECIATED,代碼行數:30,代碼來源:OurFileProvider.java

示例15: query

/**
 * Use a content URI returned by
 * {@link #getUriForFile(Context, String, File) getUriForFile()} to get information about a file
 * managed by the FileProvider.
 * FileProvider reports the column names defined in {@link android.provider.OpenableColumns}:
 * <ul>
 * <li>{@link android.provider.OpenableColumns#DISPLAY_NAME}</li>
 * <li>{@link android.provider.OpenableColumns#SIZE}</li>
 * </ul>
 * For more information, see
 * {@link ContentProvider#query(Uri, String[], String, String[], String)
 * ContentProvider.query()}.
 *
 * @param uri A content URI returned by {@link #getUriForFile}.
 * @param projection The list of columns to put into the {@link Cursor}. If null all columns are
 * included.
 * @param selection Selection criteria to apply. If null then all data that matches the content
 * URI is returned.
 * @param selectionArgs An array of {@link java.lang.String}, containing arguments to bind to
 * the <i>selection</i> parameter. The <i>query</i> method scans <i>selection</i> from left to
 * right and iterates through <i>selectionArgs</i>, replacing the current "?" character in
 * <i>selection</i> with the value at the current position in <i>selectionArgs</i>. The
 * values are bound to <i>selection</i> as {@link java.lang.String} values.
 * @param sortOrder A {@link java.lang.String} containing the column name(s) on which to sort
 * the resulting {@link Cursor}.
 * @return A {@link Cursor} containing the results of the query.
 */
@Override public Cursor query(Uri uri, String[] projection, String selection,
    String[] selectionArgs, String sortOrder) {
  // ContentProvider has already checked granted permissions
  final File file = mStrategy.getFileForUri(uri);

  if (projection == null) {
    projection = COLUMNS;
  }

  String[] cols = new String[projection.length];
  Object[] values = new Object[projection.length];
  int i = 0;
  for (String col : projection) {
    if (OpenableColumns.DISPLAY_NAME.equals(col)) {
      cols[i] = OpenableColumns.DISPLAY_NAME;
      values[i++] = file.getName();
    } else if (OpenableColumns.SIZE.equals(col)) {
      cols[i] = OpenableColumns.SIZE;
      values[i++] = file.length();
    }
  }

  cols = copyOf(cols, i);
  values = copyOf(values, i);

  final MatrixCursor cursor = new MatrixCursor(cols, 1);
  cursor.addRow(values);
  return cursor;
}
 
開發者ID:mattprecious,項目名稱:telescope,代碼行數:56,代碼來源:FileProvider.java


注:本文中的android.provider.OpenableColumns.DISPLAY_NAME屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。