Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calendar Sync #78

Open
WowHesTall opened this issue Jul 24, 2020 · 1 comment
Open

Calendar Sync #78

WowHesTall opened this issue Jul 24, 2020 · 1 comment

Comments

@WowHesTall
Copy link

Good morning,

Calendar events (Exchange mailboxes) added at the user's PC appear to take an age to update on the display.

I found that RoomReservationRefreshTask works great if I call it manually. I'm pretty new to Android development; I've not found a timer to run this and assume it's event driven. I saw that calendarChangeReceiver is registered to call the RefreshTask onReceive.

Could it be that the a broadcast is delayed or something? What would be the best way to force a refresh every minute?

Thanks
Andy

@WowHesTall
Copy link
Author

WowHesTall commented Jul 24, 2020

I couldn't think of a better way than adding this to the MainActivity.onStart().

        Toast.makeText(this, "Launch Calendar", Toast.LENGTH_SHORT).show();
        Intent launchIntent = getPackageManager().getLaunchIntentForPackage("com.google.android.calendar");
        if (launchIntent != null) {
            startActivity(launchIntent);
        }

        Timer timer = new Timer();
        timer.schedule(new TimerTask() {
            //@Override
            public void run() {
                if (model != null && initCompleted && uiStarted)
                    model.getDataProxy().refreshRoomReservations(model.getFavoriteRoom());
                    Log.d("Reservator","Timer: refreshRoomReservations");
            }
        },0,30000); //Update every 30s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant