multithreading - Android Vibration while locked/sleep -
whether user has screen on or off want notify user vibration. if screen on, works well:
vibrator vibrator = (vibrator) getapplicationcontext().getsystemservice(context.vibrator_service); long sleep = 100; long vibrate = 500; long[] vibratepattern = {0, vibrate, sleep, vibrate, sleep}; vibrator.vibrate(vibratepattern, -1);
its called thread implemented in service.
the thread runs if screen off. checked because im implementing timer. cant problem!
not sure if have looked android's notifications, sounds perfect trying achieve.
http://developer.android.com/intl/es/reference/android/app/notification.builder.html
when building notification, can cause phone vibrate setvibrate() method.
Comments
Post a Comment