小编Cat*_*ine的帖子

Android文件删除不起作用

我无法从SD卡中删除文件.

File toDelete = new File(fname);
boolean result=toDelete.delete();
Run Code Online (Sandbox Code Playgroud)

结果是错误的.对同一文件的读写操作在同一个应用程序中运行.没有打开的溪流.没有例外.我试图在删除这种方式之前使其可写

toDelete.setWritable(true);
Run Code Online (Sandbox Code Playgroud)

没有效果.系统如何可以写入和读取,但不能删除相同的文件???

android file

6
推荐指数
1
解决办法
5250
查看次数

Canvas上的Android文本大小与TextView中的文本大小不同

我有一个SurfaceView和TextView,我在上面绘制文本

Paint p = new Paint();
p.p.setTextSize(14);
canvas.drawText(....
TextView  text =...
text.setTextSize(14);
Run Code Online (Sandbox Code Playgroud)

在某些设备上,两个文本看起来完全相同.但在仿真器和三星Galaxy III上,画布上的文字要小两倍.为什么?如何在所有设备上获得相同的尺寸?

SurfaceView和TextView同时出现在屏幕上.TextView位于多个图层上,并覆盖在SurcafeView的Canvas上.

最好的祝福

android textview surfaceview

4
推荐指数
1
解决办法
1917
查看次数

为什么Picasso调试模式不起作用?

有人可以告诉我,毕加索为什么不指示调试?我有以下代码:

Picasso.with(MyActivity.this.getApplicationContext()).setDebugging(true);
Picasso.with(MyActivity.this.getApplicationContext()).load(message).into(imageView);
Run Code Online (Sandbox Code Playgroud)

在图片的左上角没有任何迹象.同时,调试模式在具有相同上下文的相同应用程序中工作正常(但对于不同的图像).小的150x150表示,但大的(1400x1400)不是.图像的大小是否重要?谢谢!

android picasso

4
推荐指数
2
解决办法
7937
查看次数

如何完全离线构建gradle项目?

环境:Linux + JDK 11 + Gradle 5.0 我有几个 gradle 项目,这些项目必须从没有互联网连接的源构建/例如,git clone --depth 1 --branch 3.0.0 https://github.com/bobbylight/RSyntaxTextArea.git首先我在线构建了这个项目,然后将 ~/.gradle 复制到 $PROJECT_DIR/grdl ,下一步我想离线测试这个版本。我执行gradle --stop,清除整个 ~/.gradle 目录,然后关闭互联网并运行以下脚本:

cp -r ./grdl/* ~/.gradle
cd RSyntaxTextArea
gradle --offline clean build
Run Code Online (Sandbox Code Playgroud)

一切都构建良好,直到我将这些文件移动到另一台Linux+JDK11+Gradle 5.0离线计算机上。当我运行相同的脚本时,出现以下错误:

./build.sh
Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':RSyntaxTextArea'.
> Could …
Run Code Online (Sandbox Code Playgroud)

offline gradle offline-caching

4
推荐指数
1
解决办法
2496
查看次数

为什么在 .parallel() 期间出现 MyBatisSystemException。在 Alfresco 6.2 中执行?

将 Alfresco form 版本 5.2 升级到版本 6.2 后,它变得不稳定:有时我们会得到:

org.mybatis.spring.MyBatisSystemException: nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: Error instantiating class java.util.ArrayList with invalid types () or values 
Run Code Online (Sandbox Code Playgroud)

通常在 .parallel() 期间。集合执行。有完整的堆栈跟踪https://pastebin.com/7d7NBwkn并且有代码https://pastebin.com/RyPt5d0g。其实我连控制流程都看不懂,为什么要涉及到MyBatis呢?

请帮我!

谢谢你!

PS:实际上这个错误的重现性并不好。当我删除 .parallel() 时,不会出现此异常。并使用单线程流处理。

UPD:以下代码在 .parallel() 的情况下会引发异常。执行并且在串行执行的情况下不会引发异常:

final SecurityManager sm = System.getSecurityManager();
   if (sm != null) {
        sm.checkPermission(new RuntimePermission("accessDeclaredMembers"));
    }
Run Code Online (Sandbox Code Playgroud)

UPD 2 解决方案:在 Alfresco 版本 5.2 System.getSecurityManager() == NULL (!!!) 但在版本 6.2 中。它已被设置。这是不同行为的问题(详细信息请参见https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/concurrent/ForkJoinPool.html)。V 6.2 设置 SecurityManager 和 v 5.2。没有。解决方案是将 Dockerfile 中的 …

alfresco mybatis

1
推荐指数
1
解决办法
535
查看次数

如何正确地将 gradle 插件添加到多项目中?

我有一个多项目 build.gradle: https://gist.github.com/iva-nova-e-katerina/7c72399ede83b5f78dbae19582974f35

该脚本失败并出现错误:

> Plugin with id 'com.github.blindpirate.osgi' not found.
Run Code Online (Sandbox Code Playgroud)

为什么?也许 buildscript {} 应该在 allprojects 之外?如何正确地将 gradle 插件添加到多项目中?

osgi gradle

1
推荐指数
1
解决办法
3659
查看次数

如何配置 openJDK11 以从源代码构建?

我需要从源代码交叉编译这个 OpenJava 分支https://gitlab.com/gosjava/11/openjdk/-/tree/master/ - 对于 aarch64-linux-gnu devkit 目标:\n为此我安装了 java 10.0.2作为主机 JDK 然后运行“./configure”

\n
\xe2\x94\x94\xe2\x94\x80$ ./configure    \n...\nconfigure: Potential Boot JDK found at /home/katya/java is incorrect JDK version (Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true); ignoring\nconfigure: (Your Boot JDK version must be one of: 10 11)\nchecking for javac... /home/katya/java/bin/javac\nchecking for java... /home/katya/java/bin/java\nconfigure: Found potential Boot JDK using java(c) in PATH\nconfigure: Potential Boot JDK found at /home/katya/java is incorrect JDK version (Picked up _JAVA_OPTIONS: -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true); ignoring\nconfigure: (Your Boot JDK version must be one …
Run Code Online (Sandbox Code Playgroud)

java java-11 openjdk-11

0
推荐指数
1
解决办法
2595
查看次数