2017-08-12 72 views
-5

我想每週六通知用戶提醒一個事件。
我正在使用Android Studio。每週六如何設置通知?

任何幫助,將不勝感激。

+1

>請參考以下鏈接https://stackoverflow.com/questions/20262711/send-notification-once-in-a-week –

+0

我試過了,不過它沒有指定通知將出現在週六 – Gry

回答

0

你可以做的是

導入這在你的java文件import java.util.Calendar;
和複製這兩者的功能,您將使用。

Calendar c = Calendar.getInstance(); 
if(c.get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY){ 
      text1.setText("True");//this is optional just to show that this is working perfectly. 
//You can do whatever in this, it will only works when the day is saturday. 
     } 
+0

你可以找到如何通知或自己顯示通知。這對於你想要的就足夠了。 –

+0

即使應用沒有運行,這是否會發送通知?謝謝 – Gry

+0

這不是用於通知。這是爲了找出是否是星期六。對於通知查找,找到幫助[這裏](https://stackoverflow.com/questions/20262711/send-notification-once-in-a-week)。 –