title: Why random words from array doesn't show when I click the button?
body: <p>I wanted to create a simple app that shows words/sentences randomly from a list that I've created every time the user click on the button.</p>
  <p>Android Studio doesn't show any error but nothing happens when I click on the button.</p>
  <p>Appreciate your help. Thank you</p>
  <p>Here's my code.
  MainActivity.java</p>
  <pre><code>
  package com.example.arraytesting4;
  
  import androidx.appcompat.app.AppCompatActivity;
  
  import android.os.Bundle;
  import android.view.View;
  import android.widget.TextView;
  import java.lang.String;
  import java.lang.StringBuilder;
  import java.util.ArrayList;
  
  public class MainActivity extends AppCompatActivity {
      ArrayList&lt;String&gt; SList;
      TextView Sentence;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          Sentence = (TextView) findViewById(R.id.Sentence);
  
      }
  
  
  public void buttonClicked(View v){
      printJoke();
  }
  
  public void printJoke() {
      StringBuilder SentenceStringBuilder = new StringBuilder();
      for (String s : SList) {
          SentenceStringBuilder.append(s + &quot;\n&quot;);
      }
      Sentence.setText(SentenceStringBuilder.toString());
  }
  }
  </code></pre>
  <p>In SList.java</p>
  <pre><code>
  package com.example.arraytesting4;
  import java.util.*;
  
  import java.util.ArrayList;
  
  public class SList extends MainActivity {
      public void Sentence(){
  
          ArrayList&lt;String&gt; SList = new ArrayList&lt;String&gt;();
  
          SList.add(&quot;Apple&quot;);
          SList.add(&quot;Banana&quot;);
          SList.add(&quot;Ciku&quot;);
          SList.add(&quot;Danny ate the others.&quot;);
  
  
      }
  }
  </code></pre>