| | |
| | | package com.moral.yunfushao.utils; |
| | | |
| | | import android.app.Activity; |
| | | import android.app.Service; |
| | | import android.content.Context; |
| | | import android.database.Cursor; |
| | | import android.os.Vibrator; |
| | | import android.provider.MediaStore; |
| | | |
| | | import com.moral.yunfushao.model.Song; |
| | |
| | | return songs; |
| | | } |
| | | |
| | | |
| | | //震动milliseconds毫秒 |
| | | public static void vibrate(final Activity activity, long milliseconds) { |
| | | Vibrator vib = (Vibrator) activity.getSystemService(Service.VIBRATOR_SERVICE); |
| | | vib.vibrate(milliseconds); |
| | | } |
| | | //以pattern[]方式震动 |
| | | public static void vibrate(final Activity activity, long[] pattern,int repeat){ |
| | | Vibrator vib = (Vibrator) activity.getSystemService(Service.VIBRATOR_SERVICE); |
| | | vib.vibrate(pattern,repeat); |
| | | } |
| | | //取消震动 |
| | | public static void virateCancle(final Activity activity){ |
| | | Vibrator vib = (Vibrator) activity.getSystemService(Service.VIBRATOR_SERVICE); |
| | | vib.cancel(); |
| | | } |
| | | } |