There is a dialog that is not called by id from navigation.

in MainActivity

  @Override public boolean onNavigationItemSelected(MenuItem item) { // Handle navigation view item clicks here. int id = item.getItemId(); if (id == R.id.recent_activity) { Intent intent = new Intent(this, RecentActivity.class); startActivity(intent); } if (id == R.id.rate_dialog) { rateApp = new RateAppFragmentDialog(); rateApp.show(getSupportFragmentManager(), "rate"); } return true; } 

In fairness, I note that the call to activate through the intent above occurs as needed.

id rechecked, correct.

UPD:

enter image description here

And what is this black mystic?

  • check under debugger if it comes inside if() - Vladyslav Matviienko
  • @metalurgus does not enter - Silento
  • So id Does not match, believe it or not - Vladyslav Matviienko
  • one
    Show the xml with the menu itself, I think the id does not match. After the screenshot, I'm even more sure that you are comparing with the wrong ID - Vladyslav Matviienko
  • @metalurgus yes, in the menu id = rate_app, mark as an answer - Silento

1 answer 1

If the inside of the condition does not go, then the ID does not match:

 if (id == R.id.rate_dialog) 

Judging by the screenshot, R.id.rate_dialog is in the rate_dialog.xml file, which, according to my guesses, is not a menu markup file, but a dialog markup file