How to remove the excess whitespace in pop menu selection? Is there any way i can remove it. I read some article here and tried the code. But its not working for me.
final Button btnwallet = findViewById(R.id.btn_wallet);
btnwallet.setOnClickListener(new View.OnClickListener() {
@TargetApi(Build.VERSION_CODES.LOLLIPOP_MR1)
@Override
public void onClick(View v) {
PopupMenu popupMenuWallet = new PopupMenu( MainActivity.this, v, Gravity.NO_GRAVITY, R.attr.actionOverflowMenuStyle, 0 );
popupMenuWallet.getMenuInflater().inflate(R.menu.menu_wallet, popupMenuWallet.getMenu());
popupMenuWallet.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
int idwallet = item.getItemId();
switch (idwallet){
case R.id.menu_wallet1:
return true;
case R.id.menu_wallet2:
return true;
default:
return MainActivity.super.onOptionsItemSelected(item);
}
}
});
popupMenuWallet.show();
}
});