在我的申请书中,Im显示通知案文,Imcon on the communication bar,但我的问题是,当用户在通知栏上发布clear
时,通知条码即已予清除。 我想预防吗? 还有一些其他问题:
- I want to create notifications for my application by different activities, say one on start it displays "Welcome to app", the second activity displays "please select", in "Data send activity" it displays "Records sent successfully"!!
- How to remove the notification on application exit.
- How to disable users to clear the notification when they press the clear button on the notification bar
- How to remove a notification from the status bar when the user presses it to open an activity?
任何帮助?
我目前的法典
private void Notification(String notificationTickerText, String Title,
String text, Notification nt) {
notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
int icon = R.drawable.nicon;
CharSequence tickerText = notificationTickerText;
long when = System.currentTimeMillis();
nt = new Notification(icon, tickerText, when);
Context context = getApplicationContext();
CharSequence contentTitle = Title;
CharSequence contentText = text;
Intent notificationIntent = new Intent(this, frmLogin.class);
PendingIntent contentIntent = PendingIntent.getActivity(this, 0,
notificationIntent, 0);
nt.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
notificationManager.notify(1, nt);
}