Code example for Spinner

Methods: setSelection

0
    public void setActiveHighlighter(String name) {
        mActiveHighlighter = name;
 
        int position = mHighlighters.getPosition(mActiveHighlighter);
        if (position >= 0 && position < mHighlighters.getCount())
            mSpinnerHighlighter.setSelection(position);
 
        mIitc.getNavigationHelper().setHighlighter(name);
    } 
 
    public void setLayers(String base_layer, String overlay_layer) {
        /* 
         * the layer strings have a form like: 
         * [{"layerId":27,"name":"MapQuest OSM","active":true}, 
         * {"layerId":28,"name":"Default Ingress Map","active":false}] 
         * Put it in a JSONArray and parse it 
         */ 
        JSONArray base_layers = null;
        JSONArray overlay_layers = null;
 
        try {