4

Hello guys Im using advance notification manager this is the code

Notification note = new Notification(); RemoteViews contentView = new RemoteViews(getPackageName(), R.layout.notif); contentView.setImageViewResource(R.id.image, R.drawable.notif); contentView.setTextViewText(R.id.title, "Focused Crawling"); contentView.setTextViewText(R.id.text, "Crawling In Progress...."); note.contentView = contentView; Intent notificationIntent = new Intent(this, LoadingActivity.class); PendingIntent contentIntent = PendingIntent.getActivity(this, 0, notificationIntent, 0); note.contentIntent = contentIntent; note.vibrate = new long[] { 500L, 200L, 200L, 500L }; note.sound = Uri.withAppendedPath(Audio.Media.INTERNAL_CONTENT_URI, "2"); note.flags |= Notification.FLAG_NO_CLEAR; mgr.notify(1337, note); startForeground(1337, note); 

and why it didnt appear at the status bar ?

1 Answer 1

17

You don't specify an icon for the status bar, which is required. Add a line like this to your code:

note.icon = R.drawable.youricon; 

See Creating a Notification

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.