Trouble witn creating notification in status bar from service Android
<p>I need to create Service in my application for showing notifications. I have the code for service:</p>

<pre><code>package com.bba.droid;

import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.IBinder;

public class AlertsMonitorService extends Service{

    @Override
    public IBinder onBind(Intent arg0) {
        // TODO Auto-generated method stub
        return null;
    }

    @Override
    public void onCreate() {

        super.onCreate();
    }

    @Override
    public void onStart(Intent intent, int id) {

        NotificationManager notifyMngr=(NotificationManager)getSystemService(Context.NOTIFICATION_SERVICE);
        Notification notification=new Notification(R.drawable.icon_back, "Downloading...", System.currentTimeMillis());

        PendingIntent contentIntent = PendingIntent.getActivity(this.getApplicationContext(), 0, null, 0);

        notification.setLatestEventInfo(this.getApplicationContext(), "YoutubeDownloader", "The video is downloading...", contentIntent);
        notifyMngr.notify(0, notification);
    }
}
</code></pre>

<p>And I have code for main Activity:</p>

<pre><code>package com.bba.droid;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;

public class DroidTestActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        Intent service=new Intent();
        service.setClass(this, AlertsMonitorService.class);
        this.startService(service);
    }
}
</code></pre>

<p>But service doesn't create a notification in status bar. Where have I made mistake? </p>
