0

I developed a simple javafx application to be ported in Android Environment, however I cant type any characters in the TextField. I guess its a bug, how to fix this one?

Th problem on galaxy S5 android 5.0.1 is not present but on galaxy tab 4 android 5.0.2 it doesn't work i type but none is displyed. Tried with normal textfield. And the problem persist also I have added the properties . Another strange rhig is that the space where recognizer. And the del button . The text not

THe code by example is very easy

Rectangle2D visualBounds = Screen.getPrimary().getVisualBounds();
        double width = visualBounds.getWidth();
        double height = visualBounds.getHeight();

TextField tt= new TextField();
        tt.setTranslateY(-150);
        StackPane stackPane = new StackPane();
        stackPane.getChildren().addAll(tt);




    borderpane.setCenter(stackPane);

    Scene scene = new Scene(borderpane, width, height);



stage.setScene(scene);

1 Answers1

0

Assuming that CustomTextField is just a custom TextField, this is a known issue, not related to the CustomTextField itself, given that it works in other device.

If you debug it:

./adb logcat -v threadtime

you surely find an exception that explains the issue: a StackOverFlow exception.

On older devices it can be solved adding this: create a java.custom.properties file, and include in it this property:

monocle.stackSize=128000

You may also include this one:

monocle.platform=Android

(it will be soon included by default in the next version)

Put the file at the root of your classpath, e.g. in the folder src/android/resources of your project.

Build and deploy the project on your mobile and check again.

José Pereda
  • 44,311
  • 7
  • 104
  • 132
  • I have tried but the problem persist I have edited the answer – Davide Malpassini Mar 30 '16 at 20:29
  • Can you run `adb` and post any possible stacktrace? – José Pereda Mar 30 '16 at 20:34
  • I haven't stacktrace when i trying to input some text, but i found something strange. When i open the keyboard it open with autocomplete feature on galaxy tab 4 while on sansung s5 i will not . This can be the source of problem and if yes how i can override this. – Davide Malpassini Apr 04 '16 at 13:03
  • By default, the JavaFX `TextField` doesn't have an autocomplete feature. Maybe your `CustomTextField` does? Can you change it to a regular `TextField` and try again? – José Pereda Apr 04 '16 at 13:10
  • Yes I have done and the problem persist also changed code to reflect standard textfield – Davide Malpassini Apr 04 '16 at 15:49
  • Could you run `adb logcat -v threadtime` and post the output (via gist/pastebin)? Without that information is really hard to tell what could be happening. Also post your build.gradle file. – José Pereda Apr 04 '16 at 16:02