Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d4468f3 authored by Vincent Bourgmayer's avatar Vincent Bourgmayer
Browse files

refactor: reorganize code of 'ImportActivity.parseCalFile()':

Move code to fetch all events from VCalendar instance before Intent instantiation
parent b54a8add
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -142,15 +142,15 @@ public class ImportActivity extends Activity {
            return;
        }

        Intent calIntent = new Intent(Intent.ACTION_INSERT);
        calIntent.setType("vnd.android.cursor.item/event");

        LinkedList<VEvent> events = calendar.getAllEvents();
        if (events == null) {
            showErrorToast();
            return;
        }

        Intent calIntent = new Intent(Intent.ACTION_INSERT);
        calIntent.setType("vnd.android.cursor.item/event");

        VEvent firstEvent = calendar.getAllEvents().getFirst();
        calIntent.putExtra(CalendarContract.Events.TITLE,
                IcalendarUtils.uncleanseString(firstEvent.getProperty(VEvent.SUMMARY)));