Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .idea/.gitignore

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/compiler.xml

This file was deleted.

20 changes: 0 additions & 20 deletions .idea/gradle.xml

This file was deleted.

30 changes: 0 additions & 30 deletions .idea/jarRepositories.xml

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/misc.xml

This file was deleted.

10 changes: 0 additions & 10 deletions .idea/runConfigurations.xml

This file was deleted.

1 change: 0 additions & 1 deletion README.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
package com.polymath.subscriptionmanager;

import android.content.ContentValues;

import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;

import android.content.Intent;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.provider.CalendarContract;

import android.view.Menu;
import android.view.MenuItem;
import android.widget.EditText;
Expand All @@ -16,6 +23,12 @@
import com.polymath.subscriptionmanager.data.SubscriptionContract.*;
import com.polymath.subscriptionmanager.data.SubscriptionDbHelper;



import java.util.Calendar;
import java.util.GregorianCalendar;


public class EditorActivity extends AppCompatActivity
{
private EditText mNameEditText;
Expand Down Expand Up @@ -85,6 +98,30 @@ private void insertCalendarIntent()
//TODO:Throw Calendar Intent



//Extracting the End Date from the StartDate
GregorianCalendar endDate = new GregorianCalendar(year, month, date);
endDate.add(Calendar.DAY_OF_MONTH, days-1);

//Making a calendar Intent
Intent calIntent = new Intent(Intent.ACTION_INSERT);
calIntent.setType("vnd.android.cursor.item/event");
calIntent.putExtra(CalendarContract.Events.TITLE, "Subscription Reminder for "+nameString);
calIntent.putExtra(CalendarContract.Events.DESCRIPTION, "This is the reminder by the Subscription Reminder app to cancel " +
"your subscription for the service "+nameString+". Your subscription will auto-renew tomorrow. Please " +
"cancel your subscription now to avoid being charged for the next session period :)");


calIntent.putExtra(CalendarContract.EXTRA_EVENT_ALL_DAY, false);
calIntent.putExtra(CalendarContract.EXTRA_EVENT_BEGIN_TIME,
endDate.getTimeInMillis()+32400000);
calIntent.putExtra(CalendarContract.EXTRA_EVENT_END_TIME,
endDate.getTimeInMillis()+32700000);

//Throw Calendar Intent
startActivity(calIntent);


//TODO:Display
}

Expand Down