title: How to use strings.xml in a list without static issue?
body: <p>I'm working on an app on Android Studio, who will be in 2 differents languages. I did two differents strings for each language. I had to put the strings in a list and call a Random for show at the user a different notification every day. </p>
  
  <p>Here's my code :</p>
  
  <p><strong>The strings.xml</strong></p>
  
  <pre><code>&lt;string-array name="notifications"&gt;
  
      &lt;item&gt;No1&lt;/item&gt;
      &lt;item&gt;No2&lt;/item&gt;
      &lt;item&gt;No3&lt;/item&gt;
      &lt;item&gt;No4&lt;/item&gt;
      &lt;item&gt;No5&lt;/item&gt;
  
  &lt;/string-array&gt;
  </code></pre>
  
  <p><strong>The class Choose.java</strong></p>
  
  <pre><code>public class Choose extends AppCompatActivity {
  
  String[] conseils=getResources().getStringArray(R.array.notifications);
  
  public String getPhraseHasard() {
  
      Random random = new Random();
      int hasard = random.nextInt(conseils.length);
  
      return conseils[hasard];
  
  } }
  </code></pre>
  
  <p><strong>The class Notification.java</strong></p>
  
  <pre><code>public class Notification extends BroadcastReceiver {
  
  
  @Override
  public void onReceive(Context context, Intent intent) {
  
   .....
  
      NotificationCompat.Builder myNotifBuilder = new NotificationCompat.Builder(context);
              myNotifBuilder.setSmallIcon(R.mipmap.ic_mind);
              myNotifBuilder.setContentTitle("A tip");
              myNotifBuilder.setContentText(Choose.getPhraseHasard());
              myNotifBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(Choose.getPhraseHasard()));
              myNotifBuilder.setAutoCancel(true);
  
  
      notifManager.notify(goOn, myNotifBuilder.build());
  
  } }
  </code></pre>
  
  <p>My problem :
  getPhraseHasard() is a non-static method so I can't use it in Notification.
  When I put static in Choose, I can't because getResources() is a non-static method too.
  Any suggestions ?</p>