i try to make an intent which is used to go to a 2nd activity. however when i try to click on it, it makes my application crash.
here's the code:
public class MainActivity extends AppCompatActivity { private Button mButtonCommande; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mButtonCommande=findViewById(R.id.buttonAccessCommande); mButtonCommande.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { openCommandeActivity(); } }); } public void openCommandeActivity() {//cette méthode me sert à envoyer vers l'activité commande Intent intent = new Intent(this, CommandeActivity.class ); startActivity(intent); } idk where it keeps crashing and i need help.