title: Toast.makeText from resource string
body: <p>I have a class named MyPrimaryClass, this class has a button witch when pressed, creates an Intent with the class myClassForResult.</p>
  
  <p>I use this to start it:</p>
  
  <pre><code>startActivityForResult(myIntentOfMyClassForResult, ACTIVITY_EDIT_BTEXT);
  </code></pre>
  
  <p>Both MyPrimaryClass, and myClassForResult extends Activity.</p>
  
  <p>So, when I call Toast.makeText within the myClassForResult, with the text parameter of R.string.my_resource_string, it gives me Force Close!</p>
  
  <p>I have tried this:</p>
  
  <pre><code>Context c = myClassForResult.this;
  Toast toast = Toast.makeText(c,
      c.getResources().getString(R.string.my_resource_string),
      Toast.LENGTH_SHORT);
  toast.show();
  </code></pre>
  
  <p>Also this: <strong>c = getApplicationContext()</strong></p>
  
  <p>Also this: <strong>c = getBaseContext()</strong></p>
  
  <p>Also this:</p>
  
  <pre><code>Context c = MyPrimaryClass.this;
  Toast toast = Toast.makeText(c,
      R.string.my_resource_string,
      Toast.LENGTH_SHORT);
  toast.show();
  </code></pre>
  
  <p>If I use an inline string, like "My toast Text!", it works. But i need to get a string from the resources.</p>
  
  <p><strong>-Problem solved:</strong></p>
  
  <p>To solve the problem I changed the duration of the Toast to Toast.LENGTH_LONG</p>
  
  <p>The string <strong>R.string.my_resource_string</strong> value is "The title is empty"</p>
  
  <p>When I change its value to "The title", it worked properly, so I guess the string was too long for the Toast.LENGTH_SHORT duration.</p>
  
  <p>But when i change the duration to <strong>Toast.LENGTH_LONG</strong>, I could use the long string.</p>
  
  <pre><code>Context c = MyPrimaryClass.this;
  Toast toast = Toast.makeText(c,
      R.string.my_resource_string,
      Toast.LENGTH_LONG);
  toast.show();
  </code></pre>