Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start second activity in android? getting error

Tags:

I have two java files. In the first I have my activity which starts when the app starts. The second is called "AuswahlActivity.java" and the xml file "auswahl.xml". I have this code into AuswahlActivity.java:

 public class AuswahlActivity extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.auswahl);
        //Your code here
    }
}

Now I want to start the activity like this:

Intent myIntent = new Intent(this, AuswahlActivity.class);
this.startActivity(myIntent);

But I get the error message The constructor Intent(new View.OnClickListener(){}, Class<AuswahlActivity>) is undefined

How do I get this working?