Я заполняю счетчик из jsonarray, и мне нужно настроить счетчик на значение, сохраненное в настройках. Я хочу установить прямую строку "id" равным "idlocatie", сохраненной в настройках.
  SharedPreferences mySharedPreferences =PreferenceManager.getDefaultSharedPreferences(this);     
    final String locatie= mySharedPreferences.getString("idlocatie", "");
 JSONObject jsonLocatii = JSONfunctions.getJSONfromURL("http://www.mySite");
      try{      
    JSONArray  earthquakes = jsonLocatii.getJSONArray("earthquakes");
        for(int i=0;i<earthquakes.length();i++){                        
            JSONObject e = earthquakes.getJSONObject(i);                
            String id = e.getString(TAG_IDLOCATIE);
            String name = e.getString(TAG_LOCATIE);             
            locatiiList.add(new Locatii(id, name.toUpperCase()));        
            locatii = (Spinner) findViewById(R.id.spinLocatie);
            LocatiiAdapter cAdapter = new LocatiiAdapter(this, android.R.layout.simple_spinner_item, locatiiList);
            locatii.setAdapter(cAdapter);                 
        }   
 }catch(JSONException e)        {
     Log.e("log_tag", "Error parsing data "+e.toString());
 }
