title: Sending Android speech recognition text to another activity
body: <p>I'm currently try to use speech recognition in my android app. Essentially, I have a main activity, a loading activity, and a text display activity. When the button in main activity is pressed the microphone is turned on and then it transitions to the loading activity where it shows a gif with bouncing dots indicated that you're speaking into the microphone. After a certain amount of silence it sends the text to the test display activity. Right now I set it up where my main activity has a button that when pressed will send you to the loading screen. I'm assuming my code to activate speech recognition will go in main activity, but I'm unsure how to send the collected data to my text display activity. If anything is unclear please let me know. My code for my activities are given below.</p>
  
  <p>Main activity</p>
  
  <pre><code>package app.test;
  
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.view.View;
  import android.widget.Button;
  import android.widget.ImageButton;
  public class MainActivity extends AppCompatActivity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          getSupportActionBar().hide();
  
          ImageButton button = (ImageButton) findViewById(R.id.imageButton2);
          button.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                      openLoading();
              }
          });
      }
  
      public void openLoading(){
          Intent intent = new Intent(this, Loading.class);
          startActivity(intent);
      }
  
  
  }
  
  </code></pre>
  
  <p>Loading activity</p>
  
  <pre><code>package app.test;
  
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.content.Intent;
  import android.os.Bundle;
  import android.speech.RecognizerIntent;
  import android.view.View;
  import android.widget.ImageView;
  import android.widget.Toast;
  
  import com.bumptech.glide.Glide;
  
  import java.util.Locale;
  
  public class Loading extends AppCompatActivity {
  private ImageView gifImageView;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_loading);
          getSupportActionBar().hide();
  
          gifImageView=findViewById(R.id.imageView2);
  
          Glide.with(Loading.this)
                  .load(R.drawable.loading)
                  .into(gifImageView);
      }
  
      @Override
      public void onBackPressed() {
  
      }
  }
  
  </code></pre>
  
  <p>text display activity</p>
  
  <pre><code>package app.test;
  
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.os.Bundle;
  import android.widget.TextView;
  
  import org.w3c.dom.Text;
  
  public class Tweet extends AppCompatActivity {
      private TextView txtResult;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_tweet);
          txtResult = (TextView) findViewById(R.id.textView);
      }
  
  }
  </code></pre>