Android手机不振动

时间:2016-12-23 21:48:53

标签: android

这是我的代码:

public void onReceive(Context arg0, Intent arg1) { 
  mySQLiteAdapter.openToWrite();
  Calendar ctaq = Calendar.getInstance();
  SimpleDateFormat dfaq = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
  String crntdt = dfaq.format(ctaq.getTime());

  String appt ="SELECT * FROM MYDATABASE_NAME where KEY_DATE ='"+crntdt+"';";
  cursor =  mySQLiteAdapter.queueAll();
  String title, place;
  title = cursor.getString(1);
  place = cursor.getString(2);
  Toast.makeText(arg0, "Beellamni keessan!!"+title+" dhaqabeera !!!!.", Toast.LENGTH_LONG).show();
  Vibrator vibrator = (Vibrator) arg0.getSystemService(Context.VIBRATOR_SERVICE);
  vibrator.vibrate(2000);
 }

为什么这不振动?

1 个答案:

答案 0 :(得分:1)

您是否记得为清单添加所需的权限?你应该添加:

{{1}}