Intent getting null in onReceive in MyAlarm class even though I sat putEctra while sending intent : MainActivity:

    package com.jimmytrivedi.alarmdemo;
    
    import android.app.AlarmManager;
    import android.app.PendingIntent;
    import android.content.Context;
    import android.content.Intent;
    import android.os.Build;
    import android.os.Bundle;
    import android.util.Log;
    import android.view.View;
    import android.widget.Button;
    import android.widget.TimePicker;
    import android.widget.Toast;
    
    import androidx.appcompat.app.AppCompatActivity;
    
    import java.util.Calendar;
    
    import butterknife.BindView;
    import butterknife.ButterKnife;
    
    public class MainActivity extends AppCompatActivity implements View.OnClickListener {
        private static final String TAG = MainActivity.class.getSimpleName();
    
        @BindView(R.id.timePicker)
        TimePicker timePicker;
        @BindView(R.id.buttonAlarm)
        Button buttonAlarm;
        @BindView(R.id.cancelAlarm)
        Button cancelAlarm;
    
        private AlarmManager alarmManager;
        private PendingIntent pendingIntent;
        private Intent intent;
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
            ButterKnife.bind(this);
            alarmManager = (AlarmManager) getSystemService(Context.ALARM_SERVICE);
            cancelAlarm.setEnabled(false);
            selClickListener();
        }
    
        private void selClickListener() {
            buttonAlarm.setOnClickListener(this);
            cancelAlarm.setOnClickListener(this);
        }
    
        @Override
        public void onClick(View v) {
            int id = v.getId();
            switch (id) {
                case R.id.buttonAlarm:
                    Calendar calendar = Calendar.getInstance();
                    if (Build.VERSION.SDK_INT >= 23) {
                        calendar.set(
                                calendar.get(Calendar.YEAR),
                                calendar.get(Calendar.MONTH),
                                calendar.get(Calendar.DAY_OF_MONTH),
                                timePicker.getHour(), timePicker.getMinute(), 0);
                    } else {
                        calendar.set(
                                calendar.get(Calendar.YEAR),
                                calendar.get(Calendar.MONTH),
                                calendar.get(Calendar.DAY_OF_MONTH),
                                timePicker.getCurrentHour(), timePicker.getCurrentMinute(), 0);
                    }
                    setAlarm(calendar.getTimeInMillis());
                    showLog("getTimeInMillis: "+calendar.getTimeInMillis() );
                    cancelAlarm.setEnabled(true);
    
                    break;
    
                case R.id.cancelAlarm:
                    cancelAlarm();
                    break;
            }
        }
    
        private void setAlarm(long time) {
            //creating a new intent specifying the broadcast receiver
             Intent intent = new Intent(this, MyAlarm.class);
             intent.putExtra("REMINDER_ID", "1");
    
            //creating a pending intent using the intent
             pendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
    
            //setting the repeating alarm that will be fired every day
            alarmManager.setRepeating(AlarmManager.RTC, time, AlarmManager.INTERVAL_DAY, pendingIntent);
            Toast.makeText(this, "Alarm is set", Toast.LENGTH_SHORT).show();
    
        }
    
        private void cancelAlarm() {
            pendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
            alarmManager.cancel(pendingIntent);
            Toast.makeText(this, "Canceled", Toast.LENGTH_SHORT).show();
        }
    
        private void showLog(String msg) {
            Log.d(TAG, msg);
        }
    }
----------------------

setAlarm:

    private void setAlarm(long time) {
            //creating a new intent specifying the broadcast receiver
             Intent intent = new Intent(this, MyAlarm.class);
             intent.putExtra("REMINDER_ID", "1");
    
            //creating a pending intent using the intent
             pendingIntent = PendingIntent.getBroadcast(this, 0, intent, 0);
    
            //setting the repeating alarm that will be fired every day
            alarmManager.setRepeating(AlarmManager.RTC, time, AlarmManager.INTERVAL_DAY, pendingIntent);
            Toast.makeText(this, "Alarm is set", Toast.LENGTH_SHORT).show();
    
        }

MyAlarm class:

    package com.jimmytrivedi.alarmdemo;
    
    import android.content.BroadcastReceiver;
    import android.content.Context;
    import android.content.Intent;
    import android.media.MediaPlayer;
    import android.provider.Settings;
    import android.util.Log;
    
    public class MyAlarm extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
            String id = intent.getStringExtra("REMINDER_ID");
            Log.d("Test", "ID: "+ id) ;
            MediaPlayer mediaPlayer = MediaPlayer.create(context, Settings.System.DEFAULT_RINGTONE_URI);
            mediaPlayer.start();
            Log.d("Test", "Alarm just fired") ;
        }
    }

Don't know why intent is getting null? BTW, onReceived called and works other things. Reminder is also coming. And I printed logs also, This: (Log.d("Test", "Alarm just fired") ;) is also printing.

Why?

Any help?
Looks like mostly code, so added some random article:

It looks like your post is mostly code; please add some more details
An article (with the linguistic glossing abbreviation art) is a word that is used with a noun (as a standalone word or a prefix or suffix) to specify grammatical definiteness of the noun, and in some languages extending to volume or numerical scope.

The articles in English grammar are the and a/an, and in certain contexts some. "An" and "a" are modern forms of the Old English "an", which in Anglian dialects was the number "one" (compare "on" in Saxon dialects) and survived into Modern Scots as the number "owan". Both "on" (respelled "one" by the Norman language) and "an" survived into Modern English, with "one" used as the number and "an" ("a", before nouns that begin with a consonant sound) as an indefinite article.

In many languages, articles are a special part of speech which cannot be easily combined[clarification needed] with other parts of speech. In English grammar, articles are frequently considered part of a broader category called determiners, which contains articles, demonstratives (such as "this" and "that"), possessive determiners (such as "my" and "his"), and quantifiers (such as "all" and "few").[1] Articles and other determiners are also sometimes counted as a type of adjective, since they describe the words that they precede.[2]

In languages that employ articles, every common noun, with some exceptions, is expressed with a certain definiteness, definite or indefinite, as an attribute (similar to the way many languages express every noun with a certain grammatical number—singular or plural—or a grammatical gender). Articles are among the most common words in many languages; in English, for example, the most frequent word is the.[3]

Articles are usually categorized as either definite or indefinite.[4] A few languages with well-developed systems of articles may distinguish additional subtypes. Within each type, languages may have various forms of each article, due to conforming to grammatical attributes such as gender, number, or case. Articles may also be modified as influenced by adjacent sounds or words as in elision (e.g., French "le" becoming "l'" before a vowel), epenthesis (e.g., English "a" becoming "an" before a vowel), or contraction (e.g. Irish "i + na" becoming "sna").

