我的项目是一个长期运行的项目.我将目标版本设置为10年,4年前.我无法将目标版本更改为23,因为我使用的是httpImageCache并且还存在UI问题.我的问题是,当Marshmallow发布时,我试图将Marshmallow与targetVersion 10整合,
int returnedPermission = ContextCompat.checkSelfPermission(MyActivity.this, Manifest.permission.WRITE_EXTERNAL_STORAGE);
Run Code Online (Sandbox Code Playgroud)
如果我从"应用程序设置"页面手动打开或关闭存储权限,此功能始终会返回"0".谁能帮帮我吗?
Future get _localPath async {
final Directory directory = await getApplicationDocumentsDirectory();
return directory.path;
}
Future _createDirectory() async {
final String path = await _localPath;
final Directory directory = await Directory('$path/CapturedImages').create(recursive: true);
print("The directory $directory is created");
}
Run Code Online (Sandbox Code Playgroud)
D / EGL_emulation(14006):eglMakeCurrent:0xeaff6780:ver 3 1(tinfo 0xc942c8e0)I / flutter(14006):目录目录:'/data/user/0/quadauq.ffmpeg_examplebyneena/app_flutter/CapturedImages'创建D/EGL_emulation (14006):eglMakeCurrent:0xeafc6d40:版本3 1(tinfo 0xdf9af9b0)
显示成功,但我在 Andrid/data 中的任何位置都看不到应用程序文件夹或创建的文件夹 - 有人可以帮忙吗?
public static int getWordCount(String sentence) {
return sentence.split("(([a-zA-Z0-9]([-][_])*[a-zA-Z0-9])+)", -1).length
+ sentence.replaceAll("([[a-z][A-Z][0-9][\\W][-][_]]*)", "").length() - 1;
}
Run Code Online (Sandbox Code Playgroud)
我的目的是计算一个句子中的单词数。该函数的输入是冗长的句子。它可能有 255 个字。
上面的正则表达式工作正常,但是当连字符或下划线出现在单词之间时,例如:合作,计数返回为 2,它应该是 1。有人可以帮忙吗?
我有一个图像显示为标记,在该图像中我必须在地图移动时更新时间
现在面临的问题是
我不知道如何在我的自定义图像中显示时间。
BitmapDescriptor descriptor = BitmapDescriptorFactory.fromResource(R.drawable.ic_remaining_time);
googleMap.addMarker(new MarkerOptions()
.position(cameraPosition.target)
.title(cameraPosition.toString())
.icon(descriptor)
);
Run Code Online (Sandbox Code Playgroud)请任何人帮助我