title: Dynamic intent parameter for start activity
body: <p>I want to create a method for starting activities. I don't want to write this every time:</p>
  
  <pre><code>Intent intent = new Intent(this, LoginActivity.class);
  startActivity(intent);
  </code></pre>
  
  <p><strong>Instead I want to use it like this: (Using 1 line instead of 2 lines)</strong></p>
  
  <pre><code>ShowActivity(LoginActivity);
  </code></pre>
  
  <p><strong>By using a custom method like this:</strong></p>
  
  <pre><code>public void ShowActivity(Activity act)
  {
      Intent intent = new Intent(this, act.class);
      startActivity(intent);
  }
  </code></pre>
  
  <p>and maybe overloading further:</p>
  
  <pre><code>public void ShowActivity(Activity act, boolean finish)
  {
      Intent intent = new Intent(this, act.class);
      startActivity(intent);
  
      if(finish)
          CurrentActivity.this.finish();
  }
  </code></pre>
  
  <p>Anyway, it's giving <em>cannot find symbol</em> error (I don't know why it's <em>cannot</em> instead of <em>can not</em> by the way). Is it possible to do so, if yes is it reasonable to do so? (Last one) If yes why not there is a 1-line method embedded to do this? </p>
  
  <p>Do I think too much "C#ish" with this approach as a Java noob?</p>
  
  <p>Thanks in advance.</p>
  
  <p>P.S. <em>I'm an Java and Android noob such that I'm not even sure about the question's title. I don't know how to ask better, therefore I couldn't search properly if this question is duplicated or not. If it's so, apologies.</em></p>