Back to project page sdk_demo_app_android.
The source code is released under:
By downloading or accessing this software, You agree to the Zendesk Terms of Service (https://www.zendesk.com/company/terms) and Application Developer and API License Agreement (https://www.zendesk.co...
If you think the Android project sdk_demo_app_android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.zendesk.rememberthedate; //from w w w .ja va 2 s. c om import android.app.Notification; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.zendesk.rememberthedate.ui.MainActivity; public class LocalNotification extends BroadcastReceiver { NotificationManager nm; @Override public void onReceive(Context context, Intent intent) { nm = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); CharSequence from = "Remember the Date"; CharSequence message = intent.getExtras().getString("message"); PendingIntent pendingIntent = PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0); Notification notif = new Notification(R.drawable.ic_notification, message, System.currentTimeMillis()); notif.setLatestEventInfo(context, from, message, pendingIntent); notif.flags = Notification.FLAG_AUTO_CANCEL; nm.notify((int)System.currentTimeMillis(),notif); } }