alarm Reminder is not working in Fragment
<p>I am working in an app which uses Fragment in which there is a  reminder with time picker but my ReminderPage class do not go to BroadcastReceiver class,I cannot find out why this is happening.</p>

<p>Here is my code for <code>RemiderPage.java</code>. </p>

<pre><code>public class ReminderPage extends android.support.v4.app.Fragment {
View view;
Button Setalarm;
TimePicker timePicker;
final static int RQS_1=1;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
}


@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,Bundle savedInstanceState) {
    view= inflater.inflate(R.layout.fragment_reminder, container, false);
    timePicker=(TimePicker)view.findViewById(R.id.timePicker);
    Setalarm=(Button)view.findViewById(R.id.button8);
    Calendar calendar=Calendar.getInstance();
    timePicker.setCurrentHour(calendar.get(Calendar.HOUR_OF_DAY));
    timePicker.setCurrentMinute(calendar.get(Calendar.MINUTE));
    Setalarm.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            Calendar cal = Calendar.getInstance();
            cal.set(timePicker.getCurrentHour(), timePicker.getCurrentMinute(), 00);

            setAlarm(cal);
        }


        private void setAlarm(Calendar targetcal) {
            Toast.makeText(getContext(), "Alarm is set", Toast.LENGTH_LONG).show();
            Intent intent = new Intent(getContext().getApplicationContext(),AlarmReceiver.class);
            PendingIntent pendingIntent = PendingIntent.getBroadcast(getContext().getApplicationContext(), RQS_1, intent, 0);
            AlarmManager alarmmanager = (AlarmManager)getActivity().getSystemService(Context.ALARM_SERVICE);
            alarmmanager.set(AlarmManager.RTC_WAKEUP, targetcal.getTimeInMillis(), pendingIntent);

        }
    });


    return view;
}
</code></pre>

<p>}</p>

<p>And here is my code for <code>AlarmReceiver.java</code>.</p>

<pre><code>public class AlarmReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
Toast.makeText(context,"Alarm received",Toast.LENGTH_LONG).show();
}
}
</code></pre>