通知バーアイコンを使用して、特定のイベントが発生したときにモバイルのユーザーに通知します。 同じことをする方法はありますか?特定のイベントでユーザーに通知する方法は?
2
A
答えて
5
私が正しく働いていたこのメソッドを使用してください。 あなたの問題を解決することを願っています。
private void notification(Context c)
{
// TODO Auto-generated method stub
EfficientAdapter1 e1=new EfficientAdapter1(c);
String ns = Context.NOTIFICATION_SERVICE;
NotificationManager mNotificationManager = (NotificationManager) e1.no(ns);
//int icon = R.drawable.xyz;//your image
CharSequence tickerText = "ticker text";
long when = System.currentTimeMillis();
Notification notification = new Notification(icon, Text, when);
Context context = c;
CharSequence contentTitle = "your title";
CharSequence contentText = " your text";
Intent notificationIntent = new Intent(context, ViewAllSMS.class);
PendingIntent contentIntent = PendingIntent.getActivity(context, 0, notificationIntent, 0);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
final int HELLO_ID = 1;
notification.flags = Notification.FLAG_INSISTENT | Notification.FLAG_AUTO_CANCEL;
mNotificationManager.notify(HELLO_ID, notification);
}
1
使用アンドロイドNotificationManager(http://developer.android.com/reference/android/app/Notification.html) アプリDEVガイド例参照してください - 必要なプロパティを設定して呼び出した後http://developer.android.com/guide/topics/ui/notifiers/notifications.html
をnotifyメソッドを使用すると、必要な通知がステータスバーに表示されます。あなたはいつもpop upsのために行くことができ
Omkar Ghaisas
1
関連する問題
- 1. 特定のユーザーにパーズプッシュ通知を送信する方法
- 2. 特定のユーザーへのApple Push通知
- 3. Pyramidとsocketioで特定のユーザーにイベントをブロードキャストする方法
- 4. 通知要求を受け入れるユーザーを特定する方法
- 5. iPhoneでイベントの使用を通知する方法。カレンダーの通知またはイベント?
- 6. スマートフォンデバイスの削除通知を特定する方法
- 7. asp.net webformでユーザーに通知する最も良い方法
- 8. iOS同じデバイス内の特定のユーザーに通知を送信するトークン
- 9. すべてのユーザーに通知を送信する方法
- 10. ユーザー通知を保存する最良の方法は?
- 11. iPhoneからの通話終了通知イベントの取得方法
- 12. 他のユーザーに通知する方法は現在オンラインですか?
- 13. Javaのイベント通知
- 14. ユーザーに新しいリンクを通知する方法
- 15. 通知を特定の時刻に設定する
- 16. 特定の時刻に通知を設定するandroid
- 17. ユーザーの既定のタイムゾーンに関係なく、特定のEST時間にローカル通知を設定する
- 18. イベントに関するオブジェクトへの通知
- 19. facebook app、ユーザーに通知して、彼に通知する
- 20. Apple Push通知用のユーザー定義サウンド?
- 21. Androidユーザーに通知する方法は接続できません
- 22. ASP.NET Mvc:日付の後に通知イベントをトリガーする方法は?
- 23. ScheduledAgentユーザー通知
- 24. 特定のユーザーが特定のセッションでアクセスしたページの数を知る方法
- 25. 通知ドロワーの通知アイコンとしてアプリアイコンを設定する方法
- 26. 通知ウィンドウから通知をクリアする方法通知ウィンドウを開いたままにする方法
- 27. プログラムで通知設定にアクセスする方法
- 28. 通知ピクセルから特定の色が
- 29. webview javascriptイベント通知
- 30. イベント通知エンジン - MSMQ
どのように通知しますか?ポップアップで? (多分トーストですか?) – seth
これはあなたのことを意味しますか? http://developer.android.com/guide/topics/ui/notifiers/notifications.html – goodm
ありがとうございます!同じものが必要です –