【发布时间】:2014-01-30 11:28:55
【问题描述】:
我正在尝试为 trigger.io 模块创建振动功能(android/java 的新功能)
我的代码在下面,但我一直得到这个
The method getSystemService(String) is undefined for the type API
我不是在导入库还是什么?
public class API {
public static void pulse(final ForgeTask task){
Vibrator v = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
// Output yes if can vibrate, no otherwise
if (v.hasVibrator()) {
v.vibrate(400);
}
}
}
【问题讨论】:
标签: android trigger.io