mirror of
https://github.com/etesync/android
synced 2025-01-11 08:10:58 +00:00
ViewCollection: use the new LocalCalendar.findByName to get calendar.
This commit is contained in:
parent
19ceab96b0
commit
7562a7a76b
@ -29,6 +29,7 @@ import com.etesync.syncadapter.resource.LocalAddressBook;
|
|||||||
import com.etesync.syncadapter.resource.LocalCalendar;
|
import com.etesync.syncadapter.resource.LocalCalendar;
|
||||||
import com.etesync.syncadapter.ui.journalviewer.ListEntriesFragment;
|
import com.etesync.syncadapter.ui.journalviewer.ListEntriesFragment;
|
||||||
|
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import at.bitfire.ical4android.CalendarStorageException;
|
import at.bitfire.ical4android.CalendarStorageException;
|
||||||
@ -77,11 +78,10 @@ public class ViewCollectionActivity extends AppCompatActivity implements Refresh
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
LocalCalendar resource = (LocalCalendar) LocalCalendar.find(account, this.getContentResolver().acquireContentProviderClient(CalendarContract.CONTENT_URI),
|
LocalCalendar resource = LocalCalendar.findByName(account, getContentResolver().acquireContentProviderClient(CalendarContract.CONTENT_URI), LocalCalendar.Factory.INSTANCE, info.url);
|
||||||
LocalCalendar.Factory.INSTANCE, CalendarContract.Calendars.NAME + "=?", new String[]{info.url})[0];
|
|
||||||
long count = resource.count();
|
long count = resource.count();
|
||||||
stats.setText(String.format(Locale.getDefault(), "Events: %d, Journal entries: %d", count, entryCount));
|
stats.setText(String.format(Locale.getDefault(), "Events: %d, Journal entries: %d", count, entryCount));
|
||||||
} catch (CalendarStorageException e) {
|
} catch (FileNotFoundException|CalendarStorageException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
stats.setText("Stats loading error.");
|
stats.setText("Stats loading error.");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user