I can’t solve a notification line

Asked

Viewed 29 times

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.

  • Where you are initiating the notification?

  • @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.

  • What error? What examples?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.