: http://developer.android.com/guide/topics/ui/notifiers/notifications.html안드로이드 사용자 정의 알림 내가 알림 표시 줄에 따라 자신의 할 일 모음
내가 자습서처럼 수행
NotificationIntent Intent = new Intent(BatteryInfoService.this,
BatteryInfoActivity.class);
ContentIntent PendingIntent = PendingIntent.getActivity(ta, 0,
notificationIntent, 0);
notification.contentIntent = contentIntent;
:
Notification notification = new Notification();
notification.flags = Notification.FLAG_ONGOING_EVENT;
notification.icon = icon;
RemoteViews contentView = new RemoteViews(getPackageName(),
R.layout.custom_notification);
contentView.setImageViewResource(R.id.image, R.drawable.b_10);
contentView.setTextViewText(R.id.title, "Custom zgłoszenie");
contentView.setTextViewText(R.id.text, "test test test");
notification.contentView = contentView;
NotificationIntent Intent = new Intent(BatteryInfoService.this,
BatteryInfoActivity.class);
ContentIntent PendingIntent = PendingIntent.getActivity(ta, 0,
notificationIntent, 0);
notification.contentIntent = contentIntent;
mNotificationManager.notify(BATTERY_ID, notification);
이 라인에 오류가 있습니다 오류 :
NotificationIntent cannot be resolved to a type
Multiple markers at this line
- ContentIntent cannot be resolved to
a type
- ta cannot be resolved to a variable
contentIntent cannot be resolved to a variable
NotificationIntent 대신 Intent를 입력하십시오. –
도움이되지 않습니다. – Defuzer