From: Marius Gavrilescu Date: Sun, 9 Jun 2013 08:29:57 +0000 (+0300) Subject: Overall cleanup X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=8a81799503a92ba371ca95720114dbea7961223e;p=unical.git Overall cleanup --- diff --git a/src/ro/ieval/unical/Attendee.java b/src/ro/ieval/unical/Attendee.java index 528121f..ede40d4 100644 --- a/src/ro/ieval/unical/Attendee.java +++ b/src/ro/ieval/unical/Attendee.java @@ -3,12 +3,13 @@ package ro.ieval.unical; import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; +import android.provider.BaseColumns; import android.provider.CalendarContract; import android.provider.CalendarContract.Attendees; final class Attendee { private static final String[] PROJECTION = { - Attendees._ID, + BaseColumns._ID, Attendees.EVENT_ID, Attendees.ATTENDEE_NAME, Attendees.ATTENDEE_EMAIL, @@ -74,6 +75,7 @@ final class Attendee { attendees[i]=new Attendee(cursor.getLong(0), cursor.getLong(1), cursor.getString(2), cursor.getString(3), cursor.getInt(4), cursor.getInt(5), cursor.getInt(6)); cursor.moveToNext(); } + cursor.close(); return attendees; } } diff --git a/src/ro/ieval/unical/Calendar.java b/src/ro/ieval/unical/Calendar.java index 686aa06..11b2667 100644 --- a/src/ro/ieval/unical/Calendar.java +++ b/src/ro/ieval/unical/Calendar.java @@ -3,11 +3,12 @@ package ro.ieval.unical; import android.content.ContentResolver; import android.content.Context; import android.database.Cursor; +import android.provider.BaseColumns; import android.provider.CalendarContract.Calendars; final class Calendar { private static final String[] PROJECTION = { - Calendars._ID, + BaseColumns._ID, Calendars.NAME, Calendars.CALENDAR_DISPLAY_NAME, Calendars.VISIBLE, @@ -46,6 +47,7 @@ final class Calendar { calendars[i]=new Calendar(cursor.getLong(0), cursor.getString(1), cursor.getString(2), cursor.getInt(3)!=0, cursor.getString(4), cursor.getString(5)); cursor.moveToNext(); } + cursor.close(); return calendars; } } diff --git a/src/ro/ieval/unical/DeleteEventDialog.java b/src/ro/ieval/unical/DeleteEventDialog.java index 809149a..2783a8c 100644 --- a/src/ro/ieval/unical/DeleteEventDialog.java +++ b/src/ro/ieval/unical/DeleteEventDialog.java @@ -12,11 +12,13 @@ public final class DeleteEventDialog extends DialogFragment { final AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(R.string.askdeleteevent) .setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { - public void onClick(final DialogInterface dialog, final int id) { + @Override + public void onClick(final DialogInterface dialog, final int id) { } }) .setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { - public void onClick(final DialogInterface dialog, final int id) { + @Override + public void onClick(final DialogInterface dialog, final int id) { // User cancelled the dialog } }); diff --git a/src/ro/ieval/unical/Event.java b/src/ro/ieval/unical/Event.java index f8e35cc..23ccd74 100644 --- a/src/ro/ieval/unical/Event.java +++ b/src/ro/ieval/unical/Event.java @@ -8,6 +8,7 @@ import android.database.Cursor; import android.net.Uri; import android.os.Parcel; import android.os.Parcelable; +import android.provider.BaseColumns; import android.provider.CalendarContract.Events; final class Event implements Parcelable{ @@ -24,7 +25,7 @@ final class Event implements Parcelable{ }; private static final String[] PROJECTION = { - Events._ID, + BaseColumns._ID, Events.ORGANIZER, Events.TITLE, Events.EVENT_LOCATION, @@ -79,6 +80,7 @@ final class Event implements Parcelable{ events[i]=new Event(cursor.getLong(0), cursor.getString(1), cursor.getString(2), cursor.getString(3), cursor.getString(4), cursor.getInt(5), cursor.getLong(6), cursor.getLong(7), cursor.getLong(8)); cursor.moveToNext(); } + cursor.close(); return events; }