title: How to take a string with commas and spaces and store in array variable
body: <p>I have this code:</p>
  
  <pre><code>        tvData1 = (TextView)findViewById(R.id.tvData1);
      tvData2 = (TextView)findViewById(R.id.tvData2);
      tvData3 = (TextView)findViewById(R.id.tvData3);
      GetData data= new GetData();
      try {
          SharedPreferences getName = PreferenceManager.getDefaultSharedPreferences(getBaseContext());
          String name = getName.getString("name", "");
          String returned = data.getData(name); //Gets data from internet
          String[] dataSplit = returned.split(",");
          for(int i = 0; i &lt; dataSplit.length; i++){
              String stringData1 = dataSplit[0];
              String stringData2 = dataSplit[1];
              String stringData3 = dataSplit[2];
  
              tvData1.setText(stringData1);
              tvData2.setText(stringData2);
              tvData3.setText(stringData3);
          }
  </code></pre>
  
  <p>well, the string gotten from the internet is like this:</p>
  
  <pre><code>"1,2,3 4,5,6"
  </code></pre>
  
  <p>and where that space is between 3 and 4 actually shows in a new line like:</p>
  
  <pre><code>1,2,3
  4,5,6
  </code></pre>
  
  <p>but basically the result i want is</p>
  
  <pre><code>stringData1 = 1
  stringData2 = 2
  stringData3 = 3
  stringData4 = 4
  etc...
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>stringData1 = 1
  stringData2 = 2
  stringData3 = 3 4
  </code></pre>
  
  <p>which is what it's doing now.</p>
  
  <p>also another irrelevant problem I seem to be having is tvData2 will not setText no matter what, even if i do tvData2.setText("Some Text");</p>