Retrieve values from array.xml and check it in main activity
<p>I have no clear working knowledge of retrieving values from an XML file and how to use it effectively.
Can some one help me understand,how to do it?</p>

<p>Here my  file and in my main activity.what i need to do,
is-i will select an operator from settings then I will check for the exact operator name and will retrieve couple of desired strings from a class named CallManager and will call by another code segmentation.
 i did it for a single operator where preString and internal digit size was fixed.So it was no problem.But i need to do for couple of them,-taking name from preferences.please help.thanks-Piyal</p>

<pre><code>&lt;string-array name="operatormodes"&gt;
    &lt;item &gt;Airtel&lt;/item&gt;
    &lt;item &gt;Banglalink&lt;/item&gt;
    &lt;item &gt;Grameen Phone&lt;/item&gt;
    &lt;item &gt;Robi&lt;/item&gt;
    &lt;item &gt;TeleTalk&lt;/item&gt;
&lt;/string-array&gt;



prefs = PreferenceManager.getDefaultSharedPreferences(this);

  // Operator
  prefs.edit().putString(PreferencesActivity.KEY_OPERATOR_MODE, CaptureActivity.DEFAULT_OPERATOR_MODE).commit();


  // Retrieve from preferences, and set in this Activity, the Operator mode
  String[] operatorModes = getResources().getStringArray(R.array.operatormodes);
  String operatorModeName = prefs.getString(PreferencesActivity.KEY_OPERATOR_MODE, operatorModes[0]);
  Log.w("im changed", "Airtel");
  if (operatorModeName.equals(operatorModes[0])) 
  {
      callManager.setOperatorName("Airtel");
      callManager.setOperatorBasedInternalDigit("Airtel");
      callManager.setOperatorBasedInternalPreString("Airtel");
      callManager.setPreString(callManager.internalPreString);
  }
  else if (operatorModeName.equals(operatorModes[1])) 
  {
      callManager.setOperatorName("Banglalink");
      callManager.setOperatorBasedInternalDigit("Banglalink");
      callManager.setOperatorBasedInternalPreString("Banglalink");
      callManager.setPreString(callManager.internalPreString);
  }
  else if (operatorModeName.equals(operatorModes[2])) 
  {
      callManager.setOperatorName("Grameen Phone");
      callManager.setOperatorBasedInternalDigit("Grameen Phone");
      callManager.setOperatorBasedInternalPreString("Grameen Phone");
      callManager.setPreString(callManager.internalPreString);
  }

  else if (operatorModeName.equals(operatorModes[3])) 
  {
      callManager.setOperatorName("Robi");
      callManager.setOperatorBasedInternalDigit("Robi");
      callManager.setOperatorBasedInternalPreString("Robi");
      callManager.setPreString(callManager.internalPreString);
  }

  else if (operatorModeName.equals(operatorModes[4])) 
  {
      callManager.setOperatorName("TeleTalk");
      callManager.setOperatorBasedInternalDigit("TeleTalk");
      callManager.setOperatorBasedInternalPreString("TeleTalk");
      callManager.setPreString(callManager.internalPreString);
  }


  prefs.registerOnSharedPreferenceChangeListener(listener);
</code></pre>
