这里是我的空间,是我用来记录点滴的沃土...

用AlarmManager定时做一些事情

AlarmManager manager = (AlarmManager) getSystemService(ALARM_SERVICE);
        Intent intent = new Intent(EditTextViewDemoActivity.this, AlarmTest.class);
        PendingIntent operation = PendingIntent.getActivity(this, 0, intent, 0);
        Calendar calendar = Calendar.getInstance();
        calendar.setTimeInMillis(System.currentTimeMillis());
        calendar.add(Calendar.SECOND, 15);
        manager.set(0, calendar.getTimeInMillis(), operation);

 

posted @   wsx2miao  Views(219)  Comments(0Edit  收藏  举报
努力加载评论中...
这里是我的空间,是我用来记录点滴的沃土...
点击右上角即可分享
微信分享提示