title: How do I get two pieces of data back from a string using try catch?
body: <p>So I am pretty new to coding and I am trying to make a scouting app for my robotics team. I am using API from The Blue Alliance, and right now I am trying to get only one piece of data back from a certain api at a time.</p>
  
  <p>I have gotten it so that I get back one piece (the city) when pressing a button but now I want to add a second button to get back something else. How would I go about this?</p>
  
  <p>Once again I am very new to this.</p>
  
  <p>Thank you in advanced
  This is the One that does work. I have to comment the second return out because it won't work</p>
  
  <pre><code>    import com.thebluealliance.api.v3.models.Team;
  
  import java.io.IOException;
  
  public class TBAAsyncGetter extends AsyncTask&lt;TBA, Void, String&gt; {
  
      @Override
      protected String doInBackground(TBA... tbas) {
  
          try {
              Event[] ourEvents = tbas[0].teamRequest.getEvents(5496);
              Event event = ourEvents[0];
  
              return ourEvents[0].event_code;
              //return ourEvents[0].event_code;
  
  
          } catch (IOException e) {
              e.printStackTrace();
              return  null;
          }
  
  
      }
  
  
  }
  </code></pre>
  
  <p>these are the Buttons and such. (ignore all the comments)</p>
  
  <pre><code>package com.example.scoutingapp4;
  
  import android.os.Bundle;
  import android.support.annotation.NonNull;
  import android.support.annotation.Nullable;
  import android.support.v4.app.Fragment;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.Button;
  import android.widget.TextView;
  
  import com.google.gson.Gson;
  import com.thebluealliance.api.v3.TBA;
  
  import java.util.concurrent.ExecutionException;
  
  public class OurTeamFragment extends Fragment implements View.OnClickListener {
      Gson gson = new Gson();
      String authKey = "tatIjlJ60oDWTv9aDk1ZDTL5GM1IJyafzPeJpWk4dR5adIgsdJt3sXvimEHA3MrI";
      TBA tba = new TBA(authKey);
  
      @Nullable
      @Override
      public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
          super.onCreateView(inflater, container, savedInstanceState);
  
          return inflater.inflate(R.layout.fragment_ourteam, container, false);
      }
  
  
      public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          Button btnGet = (Button) getView().findViewById(R.id.btnRegional);
          assert btnGet != null;
          btnGet.setOnClickListener(this);
  
          Button btnGet2 = (Button) getView().findViewById(R.id.btnEventCode);
          assert btnGet2 != null;
          btnGet2.setOnClickListener(this);
  
  
  
  
      }
  
  
      public void onClick(final View v) {
          v.setEnabled(false);
          switch (v.getId()) {
  
              case R.id.btnRegional:
  
                  try {
  
                      TextView textHeyo = (TextView) getView().findViewById(R.id.text_regional);
                      textHeyo.setText(new TBAAsyncGetter().execute(tba).get());
  
                  } catch (  ExecutionException | InterruptedException e) {
                      e.printStackTrace();
                  }
  //                AsyncHttpClient client = new AsyncHttpClient();
  //                client.addHeader("X-TBA-Auth-Key", "tatIjlJ60oDWTv9aDk1ZDTL5GM1IJyafzPeJpWk4dR5adIgsdJt3sXvimEHA3MrI");
  //                client.get("https://www.thebluealliance.com/api/v3/team/frc5496/events/2019", new AsyncHttpResponseHandler() {
  //                    @Override
  //                    public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
  //                        if (responseBody != null) {
  //                            TextView textHeyo = (TextView) getView().findViewById(R.id.text_view_result);
  //                            assert textHeyo != null;
  //                            gson.toJson(new String(responseBody));
  //
  //                            System.out.println("body=" + new String(responseBody));
  //                            textHeyo.setText(new String(responseBody));
  //
  //                        }
  //                        v.setEnabled(true);
  //                    }
  //
  //                    @Override
  //                    public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
  //
  //                        TextView textHeyo = (TextView) getView().findViewById(R.id.text_view_result);
  //                        textHeyo.setText(new String("Boom! ") + new String(responseBody));
  //
  //                        v.setEnabled(true);
  //                    }
  //
  //                });
                  break;
  
              case R.id.btnEventCode:
                  try {
  
                      TextView textHeyo = (TextView) getView().findViewById(R.id.text_event_code);
                      textHeyo.setText(new TBAAsyncGetter().execute(tba).get());
  
                  } catch (  ExecutionException | InterruptedException e) {
                      e.printStackTrace();
                  }
  //                AsyncHttpClient client2 = new AsyncHttpClient();
  //                client2.addHeader("X-TBA-Auth-Key", "tatIjlJ60oDWTv9aDk1ZDTL5GM1IJyafzPeJpWk4dR5adIgsdJt3sXvimEHA3MrI");
  //                client2.get("https://www.thebluealliance.com/api/v3/event/2020cadm/teams", new AsyncHttpResponseHandler() {
  //                    @Override
  //                    public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
  //                        if (responseBody != null) {
  //                            TextView textHeyo = (TextView) getView().findViewById(R.id.text_view_result);
  //                            assert textHeyo != null;
  //                            System.out.println("body=" + new String(responseBody));
  //                            textHeyo.setText(new String(responseBody));
  //                        }
  //                        v.setEnabled(true);
  //                    }
  //
  //                    @Override
  //                    public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
  //
  //                        TextView textHeyo = (TextView) getView().findViewById(R.id.text_view_result);
  //                        textHeyo.setText(new String("Boom! ") + new String(responseBody));
  //
  //                        v.setEnabled(true);
  //                    }
  //
  //                });
                  break;
          }
      }
  }
  
  </code></pre>