android 通知显示时间,android:在特定时间显示通知?

我有一个名为的函数show_notification(),当用户点击按钮时我会调用它.关键是,一旦他点击[如下面的函数],我不想显示通知,我想在特定的time= hours:mins

地方显示此通知.小时和分钟是两个整数,具有我想要的时间值[例如小时= 22和分钟= 40 ..意思是在22:40 [10:40 pm]发出此通知.顺便说一句,这个警报应该每天同时重复.

public void show_notification() {

CharSequence notify_msg="Don't foget!";

CharSequence title= "you ve been notified by My app";

CharSequence details= "It works!";

NotificationManager nm= (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

Notification notify= new Notification(android.R.drawable.stat_notify_more,

notify_msg,

System.currentTimeMillis());

Context mycontext= ActA.this;

Intent myintent= new Intent (mycontext, ActA.class);

PendingIntent pending= PendingIntent.getActivity(mycontext, 0, myintent, 0); ///0's are not applicable here

notify.setLatestEventInfo(mycontext, title, details, pending);

nm.notify(0, notify);

}

我希望你能详细回答,因为我是一个非常新的开发者.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值