I am creating Daily Notification App, where i am allowing user to set time. To develop this feature i am using AlarmReceiver and BroadcastReceiver.
I want to show notification message in Dialog box/Alert Box when user click on Notification.
Can someone help me to achieve this functionality?
Below is the code where i am setting Notification message.
public class AlarmReceiver extends BroadcastReceiver {
String TAG = "AlarmReceiver";
@Override
public void onReceive(Context context, Intent intent) {
// TODO Auto-generated method stub
if (intent.getAction() != null && context != null) {
if (intent.getAction().equalsIgnoreCase(Intent.ACTION_BOOT_COMPLETED)) {
// Set the alarm here.
Log.d(TAG, "onReceive: BOOT_COMPLETED");
LocalData localData = new LocalData(context);
NotificationScheduler.setReminder(context, AlarmReceiver.class, localData.get_hour(), localData.get_min());
return;
}
}
Log.d(TAG, "onReceive: ");
//Trigger the notification
NotificationScheduler.showNotification(context, MainActivity.class,
"You have New Notification", "check it now?");
}
}
Output should like this after clicking on Notification...