title: How can I start a new android activity using class name in a string?
body: <p>I'm having a problem with an android application that I'm working on. </p>
  
  <p>My application has several sections and the next screen that loads is based on a string. So, screen 1 of section 1 would be, S1S1.  </p>
  
  <p>My question is, how can I start an activity based on a string. I have S1S1 saved in a string, let us call it next activity. Rather than having to type S1S1.class, I need it to come from the string. I've tried everything I can think of and google hasn't helped much.</p>
  
  <p>Some things I've tried are</p>
  
  <pre><code>Intent myIntent = new Intent(nextactivity);
  Intent myIntent = new Intent(v.getContext(), getClass().getName().valueOf(nextactivity));
  Intent myIntent = new Intent(v.getContext(), Class.forName(nextactivity));
  </code></pre>
  
  <p>and tried running with</p>
  
  <pre><code>startActivityForResult(myIntent, 0); 
  </code></pre>
  
  <p>but nothing seems to work. Any ideas?</p>