Q:

The notification won't be "On Going"

I want to show an on going notification. but It's still shows up in Notifications part.
I used a custom layout for my notification.
here is my code:
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    NotificationManager mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

    int icon = android.R.drawable.alert_dark_frame;
    long when = System.currentTimeMillis();
    Notification notification = new Notification(icon, "Hi", when);
    RemoteViews contentView = new RemoteViews(getPackageName(),
            R.layout.custom_notification);
    notification.contentView = contentView;

    Intent notificationIntent = new Intent(this, MainActivity.class);
    PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
            notificationIntent, 0);

    notification.contentIntent = contentIntent;
    notification.defaults |= Notification.FLAG_ONGOING_EVENT;
    mNotificationManager.notify(0, notification);
}

Edit:
You can see this image to see what I want to do.
http://backcountrynavigator.com/wp-content/uploads/screenshots/download_ongoing_notification.png

A:

You should start ongoing notifications with Service.startForeground() besides NotificationManager.notify()
EDIT: I also recommend that you use Notification.Builder instead of new Notification(), and then use setOngoing(), just to keep it clean.

