getUriColumn(uri : Uri, selection : string, selectionArgs : string[]) {
const column : string = "_data";
const context = UTSAndroid.getAppContext() as Context;
const resolver = context.getContentResolver();
const cursor = resolver.query(uri, [column], selection, selectionArgs, "");
try {
if (cursor != null && cursor.moveToFirst()) {
const cursorIndex = cursor.getColumnIndexOrThrow(column);
const str = cursor.getString(cursorIndex);
console.log(str)
}
}
catch (e) {
}
finally {
if (cursor != null)
cursor.close()
}
}
5***@qq.com
- 发布:2024-10-12 16:02
- 更新:2024-10-12 16:02
- 阅读:80
uniappx 文件读写操作
分类:uni-app x