title: How to start an activity using a custom intent?
body: <p>I have a very simple application (an example from a textbook) that consists of 2 activities: The first activity <code>UsingIntentActivity</code> has a button. When this button is clicked it must lead to the second activity called <code>SecondActivity</code> which will show a text on the screen.</p>
  <p>I can achieve this using <code>startActivity(new Intent(this, SecondActivity.class));</code></p>
  <p>However in the textbook where I met this example another form of the same method is used:</p>
  <pre><code>startActivity(new Intent(&quot;net.dreamingpixel.SecondActivity&quot;));
  </code></pre>
  <p>And in the <code>Manifest File</code> a matching custom intent is created (as I understood):</p>
  <pre><code>    &lt;activity
          android:name=&quot;.UsingIntentActivity&quot;
          android:label=&quot;@string/title_activity_using_intent&quot; &gt;
          &lt;intent-filter&gt;
              &lt;action android:name=&quot;android.intent.action.MAIN&quot; /&gt;
  
              &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot; /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
      &lt;activity
          android:name=&quot;.SecondActivity&quot;
          android:label=&quot;Second Activity&quot; &gt;
          &lt;intent-filter&gt;
              &lt;action android:name=&quot;net.dreamingpixel.SecondActivity&quot; /&gt;
  
              &lt;category android:name=&quot;android.intent.category.DEFAULT&quot; /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  </code></pre>
  <p>So there is an intent-filter and its category is set to <code>DEFAULT</code>. But when I try to run the app like this and click the button of the <code>UsingIntentActivity</code> the app crashes. In the log cat I can see the following messages:</p>
  <pre><code>FATAL EXCEPTION: main
  java.lang.IllegalStateException: Could not execute the method of the activity
  </code></pre>
  <p>And then it points to the call of the startActivity method that I wrote at the beginning of this post.</p>
  <p>Did anyone have a similar problem? Did I make a mistake somewhere?</p>
  <p>UPDATE: Also I noticed that there is a warning in the <code>Manifest</code> file on the line where I open the second activity tag. It says: Exported activity does not require permission</p>
  <p>Maybe this warning has to do something with my problem..</p>