Issue
I have a Xamarin Droid project. I created a separate android library assembly and i put all my resource files (layouts, drawables, styles, ...) into that separate assembly. So no layouts are in the droid project itself.
When i try to access resources using there id, I get an exception Android.Content.Res.Resources+NotFoundException: String resource ID 0x....
this happens for calls like GetString(Resource.String.app_name)
. Also, when i try to find views by there id this.FindViewById<NavigationView>(Resource.Id.navigationView);
the return value is always null
The separation is part of a refactoring. Before the refactoring, every resource was referenced from the main droid project, but due to an enhancement concept we have to provide for our customers, we had to move layouts, views, ... to a separate assembly.
Solution
Make sure the namespace for the "Resource" class is the one you intended to target.
There will be several of these, especially if you have more than one android assembly.
Answered By - Blueberry
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.