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

Using add event calendar from background will lead to not showing the red dots #26

Closed
ma7moudAziz opened this issue Sep 25, 2019 · 2 comments

Comments

@ma7moudAziz
Copy link

ma7moudAziz commented Sep 25, 2019

I am using your library within an API call that returns all of my events during a specific month.

The API call takes place in the background and if I add the events there red dots will not show, even if use runOnUIThread{}.

Here is a peace of my code to show my issue.

getEventsPromise(month) success {
            try {

                activity?.runOnUiThread {
                    setCalendarEvents(
                        2019,
                        9,
                        2019
                    )
                }
            } catch (e: Exception) {
                
            }
        } fail {
            
        }
 private fun setCalendarEvents(year: Int, month: Int, day: Int) {
        val currentDateCalendar = Calendar.getInstance()

        val calendarInstance = Calendar.getInstance()
        calendarInstance.set(year, month, day)

        val timeDifference =
            calendarInstance.get(Calendar.DAY_OF_MONTH) - currentDateCalendar.get(Calendar.DAY_OF_MONTH)

        val eventCalendar = Calendar.getInstance()
        eventCalendar.add(Calendar.DAY_OF_MONTH, timeDifference)

        //calendarLib is the reference of EventsCalendar
        calendarLib.addEvent(eventCalendar)
    }

These are the code I am trying to use with no success.
I try "setCalendarEvents" this function outside the API call functions and it works fine the dots is shows as it should be.
Please assist.
And thank you in advance.

@innoflash
Copy link

@ma7moudAziz have you found a solution as yet?

@khandelwalp
Copy link

even I am getting the same error.

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

3 participants