asemaneiran
دوشنبه 22 شهریور 1395, 10:42 صبح
سلام
من برا نماش پوش نوتیفیکیشن از این کد استفاده کردم حالا میخوام کاربر روی اعلان که کلیک کرد اعلان حذف شه و یا به یه اکتیویتی خاص بره
ممنون میشم بگید چکار کنم؟؟
int icon = R.drawable.ic_launcher;
CharSequence tickerText = "This is a sample notification";
long when = System.currentTimeMillis();
Context context = getApplicationContext();
CharSequence contentTitle = "خوش آمدید";
String b= (String) txtfamil.getText();
CharSequence contentText = b ;
Intent notificationIntent = new Intent();
PendingIntent contentIntent = PendingIntent.getActivity(getBaseContext(), 0, notificationIntent, 0);
final Notification notification = new Notification(icon, tickerText, when);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
String ns = Context.NOTIFICATION_SERVICE;
final NotificationManager mNotificationManager1 = (NotificationManager) getSystemService(ns);
mNotificationManager1.notify(NOTIFICATION_ID, notification);
من برا نماش پوش نوتیفیکیشن از این کد استفاده کردم حالا میخوام کاربر روی اعلان که کلیک کرد اعلان حذف شه و یا به یه اکتیویتی خاص بره
ممنون میشم بگید چکار کنم؟؟
int icon = R.drawable.ic_launcher;
CharSequence tickerText = "This is a sample notification";
long when = System.currentTimeMillis();
Context context = getApplicationContext();
CharSequence contentTitle = "خوش آمدید";
String b= (String) txtfamil.getText();
CharSequence contentText = b ;
Intent notificationIntent = new Intent();
PendingIntent contentIntent = PendingIntent.getActivity(getBaseContext(), 0, notificationIntent, 0);
final Notification notification = new Notification(icon, tickerText, when);
notification.setLatestEventInfo(context, contentTitle, contentText, contentIntent);
String ns = Context.NOTIFICATION_SERVICE;
final NotificationManager mNotificationManager1 = (NotificationManager) getSystemService(ns);
mNotificationManager1.notify(NOTIFICATION_ID, notification);