0
안녕하세요, 저는 특정 시간에 사용자에게 알림을 보내야하는 앱을 개발하려고합니다. 인터넷에서 나는이 코드를 발견했지만 이클립스는 더 이상 사용되지 않는다고 말합니다. 내 API로 올바른 방법을 알 수 있습니까? (16)안드로이드 상태 표시 줄 코드는
NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
int icon = R.drawable.worldmap2;
CharSequence tickerText = "Hello";
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, tickerText,when);
Context context = getApplicationContext();
CharSequence contentTitle = "My notification";
CharSequence contentText = "Hello World!";
final Intent intent1 = new Intent(context, HttpExampleLimits.class);
PendingIntent pIntent = PendingIntent.getActivity(getApplicationContext(), 0, intent1, 0);
notification.setLatestEventInfo(context, contentTitle,contentText, pIntent);
nm.notify(1, notification);
대단히 감사합니다!