如何从javafxmobile-plugin
的android目录/图库中选择图片。我无法在Android设备中选择images
之类的文件。当我打开目录时,应用程序挂起并突然关闭。有帮助吗?
我已经在使用javafx file chooser
&& directory choose
的android设备中进行了尝试,但没有任何帮助。我也没有在stackoverflow
我的build.gradle
文件:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'org.javafxports:jfxmobile-plugin:1.3.16'
}
}
apply plugin: 'org.javafxports.jfxmobile'
repositories {
jcenter()
maven {
url 'http://nexus.gluonhq.com/nexus/content/repositories/releases'
}
}
mainClassName = 'com.maqboolsolutions.directorychooserandroid.App'
ext.CHARM_DOWN_VERSION = "1.0.0"
dependencies {
compile "com.gluonhq:charm-down-common:$CHARM_DOWN_VERSION"
desktopRuntime "com.gluonhq:charm-down-desktop:$CHARM_DOWN_VERSION"
androidRuntime "com.gluonhq:charm-down-android:$CHARM_DOWN_VERSION"
compile 'com.airhacks:afterburner.mfx:1.6.3'
}
jfxmobile {
javafxportsVersion = '8.60.11'
android {
manifest = 'src/android/AndroidManifest.xml'
packagingOptions {
exclude 'META-INF/INDEX.LIST'
}
dexOptions {
javaMaxHeapSize "4g"
}
}
}
.java
编码:
@FXML
private void btnCooserOnAction(ActionEvent event) {
DirectoryChooser directoryChooser = new DirectoryChooser();
Stage primaryStage = (Stage) stackPaneRoot.getScene().getWindow();
File selectedDirectory = directoryChooser.showDialog(primaryStage);
if (selectedDirectory == null) {
lblPath.setText("No Directory selected");
} else {
lblPath.setText(selectedDirectory.getAbsolutePath());
}
}
应用未响应。然后关闭...