public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button1 = new Button(this);
button1 = (Button) findViewById(R.id.click_me);
button1.setOnClickListener(
new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent nextActivity = new Intent(this, NextActivity.class);
startActivity(nextActivity);
}
}
);
}
Hi Guys, I'm having an error when declaring / creating a new instance of the Intent,
Intent nextActivity = new Intent(this, NextActivity.class);
It says cannot resolve constructor Intent.... What is wrong?
Sorry for the long post, hope you guys will let me know soon. Thanks!!