]> iEval git - unical.git/commitdiff
Overall cleanup
authorMarius Gavrilescu <marius@ieval.ro>
Sun, 9 Jun 2013 08:29:57 +0000 (11:29 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Sun, 9 Jun 2013 08:29:57 +0000 (11:29 +0300)
src/ro/ieval/unical/Attendee.java
src/ro/ieval/unical/Calendar.java
src/ro/ieval/unical/DeleteEventDialog.java
src/ro/ieval/unical/Event.java

index 528121fec1ab7b42c7a6aa882a5dddda6699b541..ede40d4bb0d69d76cf10806fd72313b72e604514 100644 (file)
@@ -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;
        }
 }
index 686aa06f7def16df678c905e74d921ce8cc4d391..11b2667b47b7181c6e73d21cb19e6f6a3a738fdd 100644 (file)
@@ -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;
        }
 }
index 809149a2a94279a9d4529e16e2cdea78a0a64188..2783a8ca1e47cb5ec4e61df557fc176a77504f8a 100644 (file)
@@ -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
                    }
                });
index f8e35cc78203125d6fd32f0e531b677735d6ca8c..23ccd74d5488b9ba411464bc294bf315c540a7ee 100644 (file)
@@ -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;
        }
        
This page took 0.034906 seconds and 4 git commands to generate.