Question

I have a line of code that calls the Vibrator service.

        if (vibe){
                        Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
                        v.vibrate(2000);
                        run();
                    } else {
                        run();
                    }

My app is force closing on that. Is it cause the emulator doesn't have a vibrator? Or did i do it wrong?

Was it helpful?

Solution

Yes, Please keep in mind that the vibrator alarm does not work on the Android emulator.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top