title: Dynamically use array whose name matches value in other array
body: <p>I'll do my best to explain what I want to accomplish;
  I feel if I could explain it better I wouldn't need to ask.</p>
  
  <p>I want to select item from spinner, click one of the 4 buttons to send the spinner value (array value "Medications") to the next activity.</p>
  
  <p>The values in "Medications" will have a string array of their own.</p>
  
  <p>For EXAMPLE.</p>
  
  <p>In "Medications" there is a value ENALAPRIL.</p>
  
  <p>There is a string array "ENALAPRIL" that has 4 values, </p>
  
  <p>HowString[0]</p>
  
  <p>WhatString<a href="http://i.stack.imgur.com/ldIi2.png" rel="nofollow">1</a></p>
  
  <p>WhenString[2]</p>
  
  <p>NotString[3]</p>
  
  <p>In Activity2 there are only two TextView boxes.</p>
  
  <p>The top TextView is for displaying the medication name selected from spinner</p>
  
  <p><strong><em>I CAN do this with no problem</em></strong></p>
  
  <p>The bottom TextView is for displaying a how, what, when, or not string - depending on which button was pressed to get to Activity2.</p>
  
  <p>I need the bottom TextView to use a StringArray value dynamically that was passed with Intent:</p>
  
  <p>"Medications" value(TextView1) selected needs to dynamically equal name of Array value used in (TextView2).</p>
  
  <p>I am struggling with the context and how to phrase my needs so Apologies.</p>
  
  <p>I hope that I am over-complicating something that is very, very simple.</p>
  
  <p>Activity1 layout:</p>
  
  <pre><code>&lt;Spinner
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:id="@+id/rxBox"
      android:prompt="@string/rxprompt"
      android:entries="@array/Medications"
      android:focusable="true"
      android:clickable="true"
      android:visibility="visible"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:textAlignment="center"
      android:spinnerMode="dialog"
      android:layout_centerHorizontal="true"
      android:background="@drawable/abc_search_dropdown_dark"
      android:popupBackground="@drawable/abc_ab_solid_light_holo"
      android:layout_below="@+id/helprx" /&gt;
  
  &lt;TextView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:textAppearance="?android:attr/textAppearanceMedium"
      android:text="@string/rxstudyinfo"
      android:id="@+id/helprx"
      android:layout_alignParentTop="true"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
  
      android:textStyle="bold"
      android:paddingStart="10dp"
      android:visibility="visible"
      android:textSize="20dp"
      android:lines="5" /&gt;
  
  &lt;LinearLayout
      android:orientation="vertical"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:layout_alignParentLeft="true"
      android:layout_alignParentStart="true"
      android:layout_alignParentEnd="true"
      android:paddingTop="50dp"
      android:divider="@drawable/abc_ab_share_pack_holo_dark"
      android:visibility="visible"
      android:layout_below="@+id/rxBox"&gt;
  
      &lt;Button
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="@string/dosing"
          android:id="@+id/doseButton"
          android:layout_gravity="center_horizontal"
          android:clickable="true"
          android:enabled="true"
          android:onClick="howRx" /&gt;
  
      &lt;Button
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="@string/what"
          android:id="@+id/whatButton"
          android:clickable="true"
          android:enabled="true"
          android:onClick="whatRX" /&gt;
  
      &lt;Button
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:id="@+id/whenButton"
          android:layout_gravity="center_horizontal"
          android:text="@string/when"
          android:clickable="true"
          android:enabled="true"
          android:onClick="whenRX" /&gt;
  
      &lt;Button
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:text="@string/not"
          android:id="@+id/notButton"
          android:clickable="true"
          android:enabled="true"
          android:onClick="notRX" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <hr>
  
  <p>Activity2 layout:
      </p>
  
  <pre><code>    &lt;TextView
          android:text="MEDICATION NAME"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textAlignment="center"
          android:textSize="35dp"
          android:id="@+id/rxName"
          android:paddingBottom="35dp" /&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:text="MEDICATION INFO"
          android:id="@+id/infoRx" /&gt;
   &lt;/LinearLayout&gt;
  </code></pre>
  
  <hr>
  
  <hr>
  
  <h2>CODE: Activity1</h2>
  
  <pre><code>public class studyRX extends ActionBarActivity {
  
  
  
  
  public void howRx(View view){
  
  
      Spinner medChoice = (Spinner) findViewById(R.id.rxBox);
      Intent howRxIntent = new Intent(getApplicationContext(),rxViewer.class);
      Bundle b = new Bundle();
      b.putString("medname",medChoice.getSelectedItem().toString());
  
  
  
      howRxIntent.putExtras(b);
  
      startActivity(howRxIntent);
  
      //array index 0
  }
  </code></pre>
  
  <hr>
  
  <h2>CODE: Activity2</h2>
  
  <pre><code>public class rxViewer extends ActionBarActivity {
  
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_rx_viewer);
  
      Bundle b = this.getIntent().getExtras();
      Resources r = getResources();
      String medname = b.getString("medname");
  
  
      ((TextView)findViewById(R.id.rxName)).setText(medname);
  
      // myString = getResources().getIdentifier(medname,"string",this.getPackageName());
      //((TextView)findViewById(R.id.infoRx)).setText(bang);
      //TextView t = (TextView)findViewById(R.id.infoRx);
      //int maybe = getResources().getIdentifier(bang,"arrays",this.getPackageName());
  
      Intent intentObject = getIntent();
  
  }
  </code></pre>
  
  <hr>
  
  <h2>XML:Medications</h2>
  
  <pre><code>&lt;string-array name="Medications"&gt;
      &lt;item&gt;Enalapril&lt;/item&gt;
      &lt;item&gt;Captopril&lt;/item&gt;
      &lt;item&gt;Lisinopril&lt;/item&gt;
      &lt;item&gt;Ramipril&lt;/item&gt;
      &lt;item&gt;Adenosine&lt;/item&gt;
      &lt;item&gt;Amiodarone&lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <hr>
  
  <h2>XML:Enalapril</h2>
  
  <pre><code>&lt;string-array name="Enalapril"&gt;
      &lt;item&gt; String from HOW Button  &lt;/item&gt;
      &lt;item&gt; String from WHAT Button &lt;/item&gt;
      &lt;item&gt; String from WHEN Button &lt;/item&gt;
      &lt;item&gt; String from NOT  Button &lt;/item&gt;
   &lt;/string-array&gt;
  </code></pre>
  
  <hr>
  
  <h2>XML:Captopril</h2>
  
  <pre><code>&lt;string-array name="Captopril"&gt;
      &lt;item&gt; String from HOW Button  &lt;/item&gt;
      &lt;item&gt; String from WHAT Button &lt;/item&gt;
      &lt;item&gt; String from WHEN Button &lt;/item&gt;
      &lt;item&gt; String from NOT  Button &lt;/item&gt;
  &lt;/string-array&gt;
  </code></pre>
  
  <hr>
  
  <p>All medications are formatted the same so the Array index will relate to each button</p>
  
  <p>THANK YOU!</p>