-1

I'm trying to make an Alarm with Notification in Android Studio, i try this link but i got error "Force Close". there is no error message in Log Cat. please help me to find this problem. my complete code My Complete Code is here.

public class MyAlarm extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        Log.d("Mine", "Set Daily");

        NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(context)
            .setSmallIcon(R.drawable.ic_notifications_white)
            .setContentTitle("My notification")
            .setContentText("Hello World!");

        NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
        notificationManager.notify(001, mBuilder.build());
    }
}
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
DRO
  • 1

1 Answers1

0

I guess you haven't included the Broadcast Receiver in AndroidManifest.xml

<receiver 
    android:name="MyAlarm" >
</receiver>
f0f1
  • 35
  • 4