Question: I have a problem with the application: I created a simple application that reminds me of some tasks By notification at a specified time. But
I have a problem with the application: I created a simple application that reminds me of some tasks By notification at a specified time. But the application closes without showing any errors.


it Yiew Navigate Code Befactor Build Run Iacls WCS Windaw Help MyAppZ-Alarmb,java [My_ppZapp,main] app src main java com example myappz e Alamsba 7 package coil. exanple. inyappz; tinport ... public class AlarmSba7 extends BroadcastReceiver f private static final String CHANNEL_ID = "HOSNI"; agverpide public vaid onReceive(Context context, Intent intent) \{ PendingIntent pendingIntent = PendingIntent,getActivity(context, recuestCocle: 0, new Intent(context, NainActivity, class), flags: 0); B1tilap b1tmap = B1tmapFactory.decodeResource(context.getResources(),R.drawable.1mgg); if (Build.VERSION,SDK_INT >= Build.VERSION_CODES.0) t NotificationChannel channel = new NotificationChannel(CHANWFL_TD, name: "Ny Channel Nane", NatificationlAanager. TMPORTANCE_DEFAULT); channel, setDescription("My Channel Description"); NotificationManager m = context.getSystemService(NotificationManager.cla55); ifi. createNotif1cationchannel(channel); f NotificationCompat, Builder builder = new NotificationCompat.Builder (context, CHAMWEL_ID); builder.setSmallIcon(R.drawable. Imgg) - 5etlargeTcon(bitmap) - setsound(Uri.porse("android.resource: // " + context-getPackageName () + "/" + R.raw.vil)); builder. setContentintent (pendingIntent); builder. setAutoCancel(true); NotificationllanagerCompat manager = NotificationlanagerCompat.from (context); manager. notify (id: 0, builder.build(]); f f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
