title: Error creating an intent on Android Studio
body: <p>Using <code>import android.content.Intent;</code> from Lompa solve my problem on the main <code>.java</code> file and manifest but not in the second <code>.java</code> file</p>
  
  <p>Here is the code:</p>
  
  <pre><code>package com.tutorial.helloworld;
  
  import android.os.Bundle;
  import android.util.Log;
  import android.content.Intent;
  
  public class SecondActivity extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_my);
  
          String varString = getIntent().getStringExtra("Test");
          Log.d("HelloWorld - Second Activity", varString);
      }
  }
  </code></pre>
  
  <p>Here the errors:</p>
  
  <pre><code>G:\Crear_Apps\Projects\HelloWorld\app\src\main\java\com\tutorial\helloworld\SecondActivity.java
  
  Error:(6, 37) error: cannot find symbol class Activity
  
  Error:(8, 5) error: method does not override or implement a method from a supertype
  
  Error:(10, 9) error: cannot find symbol variable super
  
  Error:(11, 9) error: cannot find symbol method setContentView(int)
  
  Error:(13, 28) error: cannot find symbol method getIntent()
  </code></pre>
  
  <hr>
  
  <p>I was following the steps of a tutorial and gave me an error creating an "intent", I searched solutions but nothing works, idk if it's because Android Studio is bugged or is my error, I restarted Android Studio too but nothing happen.</p>
  
  <p>MyActivity.java</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_my);
      Log.d("HelloWorld","onCreate");
  
      Intent i = new Intent(this, SecondActivity.class);
      i.putExtra("Test","true");
  
      startActivity(i);
  }
  </code></pre>
  
  <p>SecondActivity.java</p>
  
  <pre><code>public class SecondActivity extends Activity{
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_my);
  
          String varString = getIntent().getStringExtra("Test");
          Log.d("HelloWorld - Second Activity",varString);
      }
  }
  </code></pre>
  
  <p>AndroidManifest.xml</p>
  
  <pre><code>        &lt;/activity&gt;
              &lt;activity android:name="com.tutorial.helloworld.SecondActivity"&gt;
              &lt;/activity&gt;
      &lt;/application&gt;
  </code></pre>
  
  <p>Errors I get</p>
  
  <pre><code>G:\Crear_Apps\Projects\HelloWorld\app\src\main\java\com\tutorial\helloworld\MyActivity.java
  Error:(20, 9) error: cannot find symbol class Intent
  Error:(20, 24) error: cannot find symbol class Intent
  G:\Crear_Apps\Projects\HelloWorld\app\src\main\java\com\tutorial\helloworld\SecondActivity.java
  Error:(6, 37) error: cannot find symbol class Activity
  Error:(8, 5) error: method does not override or implement a method from a supertype
  Error:(10, 9) error: cannot find symbol variable super
  Error:(11, 9) error: cannot find symbol method setContentView(int)
  Error:(13, 28) error: cannot find symbol method getIntent()
  </code></pre>