title: How do I put EditText into an array?
body: <p>I want to use numbers separated by commas or spaces and return statistics like mean median mode std dev, etc. How would I go about making an array and using the contents of the array after the use inputs them and do a simple statistical calculation? I'm new to android developing right now, so I'm not too familiar with all the different methods. And no this is not for any schoolwork or homework, I'm making an app and here is proof: <a href="https://goo.gl/9mt4ql" rel="nofollow">https://goo.gl/9mt4ql</a></p>
  
  <pre><code>package erm.customcalculator.fragments;
  
          import android.os.Bundle;
          import android.view.LayoutInflater;
          import android.view.View;
          import android.view.ViewGroup;
          import android.widget.EditText;
          //import java.lang.*;
          import erm.customcalculator.R;
  
  
  public class StatsFragment extends CalcBase {
  
      EditText etnums;
      double nums;
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container,
                               Bundle savedInstanceState) {
          View v = GatherViews(inflater, container);
  
  
          return v;
      }
  
      private View GatherViews(LayoutInflater inflater, ViewGroup container) {
          View v = inflater.inflate(R.layout.fragment_standard_error, container,
                  false);
          etnums = (EditText)v.findViewById(R.id.value_p);
          return v;
      }
  
      @Override
      public String getNameOfCalculation() {
          return getString(R.string.standard_error);
      }
  
      @Override
      public void clearPage() {
          etnums.setText("");
  
      }
  
  
      @Override
      public String returnMessageIfBadFormData() {
          if(isEmpty(etnums)){
              return "All values required for computation";
          } else {
              nums = getDouble(etnums);
  
              return "";
          }
      }
  
      @Override
      public String calculate() throws Exception {
  
          double total = 0;
          double var = 0;
          for (double element : nums){
              total = total + element;
              double average = total / element;
          }
  
          double sum = total;
  
          for (double element : nums) {
              double average = total / element;
              var += (Math.pow((element - average), 2) / element);
  
          }
  
          double std_dev = Math.pow(var, 0.5);
          double average = total / element;
  
          return String.valueOf("Sum: " + sum +
                  "Mean: " + average +
                  "Standard Deviation: " + std_dev +
                  "Variance: " + var);
      }
  }
  </code></pre>