2012-01-05 11 views
4

こんにちはみんなイムは表示されません。なぜこのようなコード私の通知は、事前通知マネージャを使用して

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); 

、なぜそれがステータスバーに表示されますdidntは?

答えて

17

ステータスバーのアイコンを指定する必要はありません。 は、あなたのコードに次のような行を追加します。

note.icon = R.drawable.youricon; 

Creating a Notification

を参照してください。
関連する問題