title: Converting 2 Dimensional String Array to Json
body: <p>I'm new to java and android programming and I want to convert string array to json. Here's the format:</p>
  
  <pre><code>String[][] filters = new String[2][5];
  
  for(int i=0; i&lt;5; i++){
     filters[0][i] = "text";
  }
  
  for(int i=0; i&lt;5; i++){
     filters[1][i] = "text";
  }
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>JSONArray mJSONArray = new JSONArray(Arrays.asList(filters));
  
  session.editor.putString("filters",mJSONArray.toString());
  session.editor.commit();
  </code></pre>
  
  <p>then I checked it by printing it out like this </p>
  
  <pre><code>System.out.println(session.pref.getString("filters", null);) 
  </code></pre>
  
  <p>but the output is like this</p>
  
  <pre><code>["[Ljava.lang.String;@41b91028","[Ljava.lang.String;@41b910a8"]
  </code></pre>
  
  <p>The reason why I want to convert it to json is because I want to pass it to a SharedPreferences, which requires a string to be passed. Also, I would also like to know how to decode it. Thanks.</p>