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

Fixed #1196 - Loading weather image. #1198

Merged
merged 2 commits into from
Apr 11, 2024

Conversation

amrhossamdev
Copy link
Member

@amrhossamdev amrhossamdev commented Apr 2, 2024

Fixes #1196.

I used a dummy keystore to generate a release version, but it crashed when I opened the app!

The app does not detect any resId when I search for weather icons in the release version.

This method is responsible for getting an image resource from the drawable using the resource name.

int resId = context.getResources().getIdentifier(resName, "drawable", context.getPackageName());

The method worked well with the debug version, but in the release version, it's not working. It's strange, but I think the resource names may have been parsed, and their names were changed during the release version. Therefore, I used a safer function that directly calls the path of the image from a drawable resource. I have tested it in a release version, and it's working.

  • Apply the AndroidStyle.xml style template to your code in Android Studio.

  • Run the unit tests with gradlew connectedObaGoogleDebugAndroidTest to make sure you didn't break anything

  • If you have multiple commits please combine them into one commit by squashing them for the initial submission of the pull request. When addressing comments on a pull request, please push a new commit per comment when possible (reviewers will squash and merge using GitHub merge tool)

Signed-off-by: Amr Hossam <amrhossam.dev@gmail.com>
Signed-off-by: Amr Hossam <amrhossam.dev@gmail.com>
Copy link
Member

@aaronbrethorst aaronbrethorst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great work, Amr 👍

@aaronbrethorst aaronbrethorst merged commit da9fd21 into OneBusAway:main Apr 11, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

Crash android.content.res.Resources$NotFoundException in setWeatherImage()
2 participants