I have a few interesting cases when trying to load dynamic layers with sublayers.
1) If I create a layer doing something like this:
UserCredentials credentials <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">UserCredentials</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
credentials<SPAN class="punctuation token">.</SPAN><SPAN class="token function">setUserAccount</SPAN><SPAN class="punctuation token">(</SPAN>uname<SPAN class="punctuation token">,</SPAN> pword<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN>
ArcGISDynamicMapServiceLayer serviceLayer <SPAN class="operator token">=</SPAN> <SPAN class="keyword token">new</SPAN> <SPAN class="token class-name">ArcGISDynamicMapServiceLayer</SPAN><SPAN class="punctuation token">(</SPAN>url<SPAN class="punctuation token">,</SPAN> <SPAN class="keyword token">int</SPAN><SPAN class="punctuation token">[</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">{</SPAN>parentId<SPAN class="punctuation token">}</SPAN><SPAN class="punctuation token">,</SPAN> credentials<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">;</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>For a layer with 5 sublayers, all default visible, nothing shows. So I wind up having to initialize the layer, listen for the status change, loop through the layer infos to retrieve the sublayer ids, then add a new layer to the MapView using an array containing the parent and all child IDs. On iOS using just the parent ID is sufficient.
2) If I only want 1 visible sublayer, on iOS I can pass just the ID of the sublayer. But on Android, I have to pass the parent and sublayer IDs. Am I going about this all wrong?