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

5x2 Widget crash with custom date #598

Open
gadolf66 opened this issue Aug 13, 2021 · 5 comments · May be fixed by #703
Open

5x2 Widget crash with custom date #598

gadolf66 opened this issue Aug 13, 2021 · 5 comments · May be fixed by #703

Comments

@gadolf66
Copy link

Hi.

Device: Motorola G7 Play
OS: Lineage 18.1 / Android 11

If I change the date format to
WhatsApp Image 2021-08-13 at 07 56 57

... the widget (5x2) becomes this
WhatsApp Image 2021-08-13 at 07 57 47

And if I tap on that blue screen, the app crashes.

Follows logcat, in case it's useful
logcat.txt

@robinpaulson
Copy link
Contributor

Huh, interesting. We've had both those things before, but I've not seen them happening together.

@robinpaulson
Copy link
Contributor

this looks relevant
08-13 07:56:04.726 -0300 8124 8124 E AndroidRuntime: FATAL EXCEPTION: main
08-13 07:56:04.726 -0300 8124 8124 E AndroidRuntime: Process: com.casticalabs.forecastie, PID: 8124
08-13 07:56:04.726 -0300 8124 8124 E AndroidRuntime: java.lang.RuntimeException: Unable to start receiver com.casticalabs.forecastie.widgets.ClassicTimeWidgetProvider: java.lang.StringIndexOutOfBoundsException: String index out of range: -2

particularly, "string index out of range"

@robinpaulson
Copy link
Contributor

robinpaulson commented Aug 13, 2021

I assume a number between, say 0 and 6 is expected for some input or other. for an unknown reason -2 is returned. we could put in some logic to force it to default to 0 if it is outside the allowed range, or even better find out why it is sometimes -2

@HonestAbe7
Copy link

The clock widget crashes when I try to place it on my screen too.

@kmantel
Copy link

kmantel commented Dec 27, 2023

Looked in the code for this and it appears to be related to a missing hyphen "-" in certain date/time formats, someone else found this here #287 (comment)

#365 fixed this for TimeWidgetProvider.java, but not for ClassicTimeWidgetProvider.java which also has this problem

kmantel added a commit to kmantel/forecastie that referenced this issue Dec 29, 2023
@kmantel kmantel linked a pull request Dec 29, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants