Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 fStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started