잘 작동하는 안드로이드 알림 코드를 다음과 같이 시도했지만 안드로이드 앱을 시작할 때 알림 팝업이 나타납니다.48 시간마다 안드로이드 알림을 표시하는 방법은 무엇입니까?
나는 48 시간마다 알림을 표시하고 싶습니다. 어떻게해야합니까?
이 기능을 사용하려면 어떤 변경을해야합니까? 이 방법에서 일을
알림 코드
Intent notificationIntent = new Intent(MainActivity.this, Activity.class);
PendingIntent contentIntent = PendingIntent.getActivity(MainActivity.this, 0, notificationIntent, 0);
NotificationManager notificationManager = (NotificationManager) MainActivity.this
.getSystemService(Context.NOTIFICATION_SERVICE);
Notification noti = new NotificationCompat.Builder(MainActivity.this)
.setSmallIcon(R.drawable.ic_launcher)
.setTicker("ticker message")
.setWhen(System.currentTimeMillis())
.setContentTitle("HELLO")
.setContentText("PLEASE CHECK WE HAVE UPDATED NEWS")
.setContentIntent(contentIntent)
//At most three action buttons can be added
.setAutoCancel(true).build();
int notifyID =0;
notificationManager.notify(notifyID, noti);
안녕이 이동 : [http://stackoverflow.com/questions/15449511/show-notification-in-every-3-sec-in-android](http : //stackoverflow.com/questions/15449511/show-notificatio n-in-every-3-sec-in-android) –
또는 이것으로 이동 : [http://stackoverflow.com/questions/7077420/show-android-notification-every-five-minutes?rq=1] (http://stackoverflow.com/questions/7077420/show-android-notification-every-five-minutes?rq=1) –
@SimplePlan 두 코드가 작동하지 않습니다. ( – Neo