codenameone / CodenameOne

Cross-platform framework for building truly native mobile apps with Java or Kotlin. Write Once Run Anywhere support for iOS, Android, Desktop & Web.

Home Page:https://www.codenameone.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Vibrate on Android not Working

ictlabs opened this issue · comments

Describe the bug
When run command to reproduce vibration on Android device it doesn't work, i am sure until few weeks ago it run correctly.

To Reproduce
I made a simple code with just a button to run vibration and it not work.

Button vibrate = new Button("Click to Vibrate!");
vibrate .addActionListener((e) -> {
Display.getInstance().vibrate(1000);
});

Expected behavior
The device should vibrate for 1 second

Smartphone (please complete the following information):
The problem is persistent with all android device i tested.

just a beginner wanna do some contribution, so can u specify the name of the activity where this method is declared

Notice that this isn't a verified issue. It's possible that this isn't happening or is happening inconsistently.
Vibrate on Android is implemented in AndroidImplementation.java. Don't be discouraged by the size of the file. It's just noise.

It's probable that this is just a permissions issue. I suggest reproducing the problem first and looking in the console for the error message to see if there are hints regarding that.