title: JSONArray to Spinner
body: <p>I have a problem. I don't set JSONArray to Spinner. My JSON look <code>["category1","category2","category3"]</code>
  How to get this JSONArray to spinner? I don't know if my code is well </p>
  
  <pre><code>public class Main extends Activity {
  
      String urlCat = "http://tvapp.pcrevue.sk/categories.json";
  
      @Override
      public void onCreate(Bundle icicle) {
          super.onCreate(icicle);
  
           JSONArray jsonArray = getJSONArrayFromUrl(urlCat);
  
          final ActionBar actionBar = getActionBar();
          actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
          actionBar.setDisplayShowTitleEnabled(false);
          actionBar.setDisplayUseLogoEnabled(false);
          ArrayAdapter&lt;String&gt; spinnerMenu = new ArrayAdapter&lt;String&gt;(actionBar.getThemedContext(), android.R.layout.simple_list_item_1, jsonArray);
          actionBar.setListNavigationCallbacks(spinnerMenu, 
                  new ActionBar.OnNavigationListener() {
  
                      @Override
                      public boolean onNavigationItemSelected(int itemPosition, long itemId) {
                          FragmentTransaction tx = getFragmentManager().beginTransaction();
                          switch (itemPosition) {
                          case 0:
                              tx.replace(android.R.id.content, new Tab1Fragment());
                              break;
                          case 1:
                              tx.replace(android.R.id.content, new Tab2Fragment());
                              break;
  
                          default:
                              break;
                          }
                          tx.commit();
                          return false;
                      }
                  });
      }
  
      public JSONArray getJSONArrayFromUrl(String url) {
          InputStream is = null;
          JSONArray jObj = null;
          String json = "";
          // Making HTTP request
          try {
              // defaultHttpClient
              DefaultHttpClient httpClient = new DefaultHttpClient();
              HttpGet httpGet = new HttpGet(url);
  
              HttpResponse httpResponse = httpClient.execute(httpGet);
              HttpEntity httpEntity = httpResponse.getEntity();
              is = httpEntity.getContent();
  
          } catch (UnsupportedEncodingException e) {
              e.printStackTrace();
          } catch (ClientProtocolException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
  
          try {
              BufferedReader reader = new BufferedReader(new InputStreamReader(is, "iso-8859-1"));
              StringBuilder sb = new StringBuilder();
              String line = null;
              while ((line = reader.readLine()) != null) {
                  //json += line;
                  sb.append(line + "\n");
              }
              is.close();
              json = sb.toString();
          } catch (Exception e) {
              Log.e("Buffer Error", "Error converting result " + e.toString());
          }
  
          // try parse the string to a JSON object
          try {
              jObj = new JSONArray(json);
          } catch (JSONException e) {
              Log.e("JSON Parser", "Error parsing data " + e.toString());
          }
  
          // return JSON String
          return jObj;
  
      }
  }
  </code></pre>
  
  <p>I need your help.
  Thx</p>