Make sure your return statement exists at the end of the code segment
Eg: public boolean onContextItemSelected(@NonNull MenuItem item) {
if(item.getItemId() == R.id.call){
Toast.makeText(getApplicationContext(),"calling code",Toast.LENGTH_LONG).show();
}
return super.onContextItemSelected(item);
}