package com.javacodegeeks.android.androidtimerexample;

import java.util.Calendar;

import android.app.Activity;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.app.TimePickerDialog;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.TimePicker;
import android.widget.Toast;

public class Alarm04 extends Activity 
{
  
    TimePicker TimePicker;
    DatePicker DatePicker;
    Button Setalarm;
    TimePickerDialog timePickerDialog;
    final static int RQS_1 = 1;
    
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.alarm03);
  
        
           
    }
    
//    http://www.androidhub4you.com/2013/12/android-alarm-manager-example-how-to.html
    
    //http://www.javaguru.one/2016/06/08/android-service-tutorial/
    
    private void setForMonday()
    {
        Calendar calendar = Calendar.getInstance();


       // calendar.set(Calendar.AM_PM, 1);
        
        
        
        calendar.set(Calendar.DAY_OF_WEEK,2);
        calendar.set(Calendar.HOUR_OF_DAY,9);
        calendar.set(Calendar.MINUTE, 00);
        calendar.set(Calendar.SECOND, 0);
        calendar.set(Calendar.MILLISECOND, 0);
        System.out.println("Old is set@ :== " + calendar.getTime());


        long interval = calendar.getTimeInMillis() + 604800000L;
        System.out.println("Next Millis = " + interval);
        //alarmManager.setRepeating(AlarmManager.RTC_WAKEUP, calendar.getTimeInMillis(), interval, pendingIntent);
        
      //  alarmMgr.setRepeating(AlarmManager.RTC_WAKEUP, startDate.getTime(), AlarmManager.INTERVAL_DAY, pendingItent);
        
        
        
        // 60 * 60 * 24 * 1000ms
        // 86400000 * 7 = 604800000
        
    }

   
   

}

