That work around did indeed solve the problem. Would my proposed code be
expected to work? If so, I can report a bug for it.

In addition to lowercasing "ActivityAthleteTwopane", I also needed to
lowercase "ActivityAthleteList". Otherwise, it attempted to create a second
ActivityAthleteList entry in the Resource.Designer.cs file.

I agree that it's odd that they would include that functionality in what
basically amounts to a sample application, but fail to document it. That's
why I was having so much trouble finding resources on it. If you want to
see it in action, with the latest Android SDK and ADT Tools for Eclipse
installed, create a new "Android Application Project" in Eclipse with a
minimum API version of at least 11 (Honeycomb). Choose "MasterDetailFlow"
on the "Create Activity" screen. Finish the wizard, then reference the
refs.xml files in the "/res/values-large" and "/res/values-sw600dp"
folders. That should hopefully be at least a start.

Thanks for the help! Let me know if you need any more information.

Andrew Gaspar


On Mon, Sep 17, 2012 at 3:26 PM, Jonathan Pryor <[email protected]> wrote:

> When will we plug all the leaky abstractions...
>
> On Sep 17, 2012, at 11:14 AM, Andrew Gaspar <[email protected]>
> wrote:
> > I'm having an issue with Resource Aliases.
>
> Is there any documentation on these Resource Aliases? The closest I found
> was for ID resources:
>
>
> http://developer.android.com/guide/topics/resources/more-resources.html#Id
>
> However, the documentation doesn't state that <item/> can have a body.
> However, the documentation for Integer Array and Typed Array both state
> that <item/> can have a body which is a resource reference:
>
>
> http://developer.android.com/guide/topics/resources/more-resources.html#IntegerArray
>
> http://developer.android.com/guide/topics/resources/more-resources.html#TypedArray
>
> > I'm trying to replicate this in MonoDroid to no avail. Here is the
> contents of the refs.xml file in my MonoDevelop project:
> >
> > <resources>
> >       <item type="layout"
> name="ActivityAthleteList">@layout/ActivityAthleteTwopane</item>
> > </resources>
> >
> > The layout resource files are appropriately renamed from
> activity_athlete_list.xml to ActivityAthleteList.axml and from
> activity_athlete_twopane.xml to ActivityAthleteTwopane.axml.
> >
> > Unfortunately, I keep getting an error: Error: No resource found that
> matches the given name (at 'ActivityAthleteList' with value
> '@layout/ActivityAthleteTwopane').
> >
> > Does anybody know how to resolve this issue, or if this is even possible
> in MonoDevelop?
>
> This is a bug.
>
> Android doesn't like PascalCased resource names for filename-backed
> resources, and @layout/ActivityAthleteTwopane is (presumably) file backed
> as Resources\layout\ActivityAthleteTwopane.axml.
>
> Mono for Android adds support for PascalCased resource names by
> lowercasing all the resource names + references as part of the build
> process (see the files in e.g. obj\Debug\res). Unfortunately I didn't know
> about the <item/> element, or that the <item/> element could contain a
> resource reference. Result: <item/> isn't fixed, and contains
> @layout/ActivityAthleteTwopane instead of @layout/activityathletetwopane.
>
> The workaround? Use the "internal" name, @layout/activityathletetwopane.
>
>  - Jon
>
> _______________________________________________
> Monodroid mailing list
> [email protected]
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to