0
The error is on the line: notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);. I couldn’t fix it. Any change I make makes a mistake.
// Define Notification's message and Intent
CharSequence contentTitle = context.getString(R.string.notif_title);
CharSequence contentText = String.format(context.getString(R.string.notif_text),
iptext);
Intent notificationIntent = new Intent(context, FTP_Start_Stop.class);
notificationIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP
| Intent.FLAG_ACTIVITY_SINGLE_TOP);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0,
notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
notification.flags |= Notification.FLAG_ONGOING_EVENT;
Put your code.
– Bruno
Where you are initiating the
notification
?– Rodrigo Paixão
@Rodrigopaixão Serverrunningnotification.java, I need to modify this part, but I don’t know how to do it. I follow the examples, and gives error.
– Ad Bahia
What error? What examples?
– Rodrigo Paixão