findViewById(R.id.btn_who).setOnClickListener(new View.OnClickListener() { @Override publicvoidonClick(View v){ PopupMenu popup = new PopupMenu(MainActivity.this, findViewById(R.id.btn_who)); popup.getMenuInflater().inflate(R.menu.menu_pop, popup.getMenu()); popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() { @SuppressLint("SetTextI18n") @Override publicbooleanonMenuItemClick(MenuItem item){ switch (item.getItemId()){ case R.id.monika: tv.setText("Sure, just Monika"); break; case R.id.sayori: case R.id.natsuki: case R.id.yuri: tv.setText("Oh god, you selected " + item.getTitle() + " . But you should know\nJUST MONIKA, right?"); break; case R.id.delete: tv.setText("Wait...What? You mean you don't need Monika anymore?"); break; } returntrue; } }); popup.show(); } }); } }