我的问题是关于是否有任何方法可以创建计时器并让Android应用程序在计时器到达android studio的某个时间时发送通知。
答案 0 :(得分:0)
试试这个
final Handler handler = new Handler();
handler.postDelayed(new Runnable() {
@Override
public void run() {
Notification noti = new Notification.Builder(mContext)
.setContentTitle("New mail from " + sender.toString())
.setContentText(subject)
.setSmallIcon(R.drawable.new_mail)
.setLargeIcon(aBitmap)
.build();
}
}, 5000); //run after 5secs