我試着去創建一個trigger.io模塊振動功能(新到Android/JAVA)來電振動trigger.io模塊
我是下面的代碼,但我不斷收到這個
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);
}
}
}
從trigger.io得到了相同響應的回覆,但是感謝這個修復了! –