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

Resources$NotFoundException #2

Open
nightwolf738 opened this issue May 31, 2017 · 1 comment
Open

Resources$NotFoundException #2

nightwolf738 opened this issue May 31, 2017 · 1 comment

Comments

@nightwolf738
Copy link

I'm getting android.content.res.Resources$NotFoundException: Resource ID #0x0 error for this:

FlagKit.drawableWithFlag(getContext(), "TR")

Since passing capital letters causes this exception. I solve the issue by passing tr

But it would be better if you solve this in SDK like this:

public static Drawable drawableWithFlag(Context context, String flagName) {
        Resources res = context.getResources();
        int resourceId = res.getIdentifier(flagName.toLowerCase(), "drawable", context.getPackageName());
        return res.getDrawable(resourceId);
    }
@hafs-r
Copy link

hafs-r commented Nov 6, 2019

converting the iso to small letters, worked for me.

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

2 participants