private NotificationManager Noti;
public void onCreate() {
....
//add Notification Massage
Noti = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
....
showNotification(R.drawable.start, "start");
}
private void showNotification(int iconId, String text) {
Intent notifyIntent = new Intent(this, RemoteService.class);
notifyIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent appIntent = PendingIntent.getActivity(RemoteService.this, 0,
notifyIntent, 0);
Notification myNoti = new Notification();
myNoti.icon = iconId;
myNoti.tickerText = text;
myNoti.defaults = Notification.DEFAULT_SOUND;
myNoti.setLatestEventInfo(RemoteService.this, "Usb2Net", text, appIntent);
Noti.notify(0, myNoti);
}