i have this Intent Code:
Intent arbeiten = new Intent(this, arbeiten.class);
startActivity(arbeiten);
but Eclipse tells me:
The constructor Intent(new AdapterView.OnItemClickListener(){}, Class<arbeiten>) is undefined
Other (working) Intents in the same Project, but other Class looks like
Intent toolb = new Intent(this, ToolBox.class);
toolb.putExtra("json", json.toString());
startActivity(toolb);
And they are working…
The “Arbeiten”-Class looks like this:
package XXX;
import android.app.Activity;
import android.os.Bundle;
public class arbeiten extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
It is because
thisrefers to yourOnItemClickListener. There are different ways of solving this. One way is to make a reference to the context of the activity like this:Then in your
OnClickListener, change it to this: