i want to show a custom popup menu when user click on a floating icon
the float icon create with an service and i have no activity
this is my floating icon c
In my case, I was inflating a PopupMenu at the very beginning of the activity i.e on onCreate()... I fixed it by putting it in a Handler
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
PopupMenu popuMenu=new PopupMenu(SplashScreen.this,binding.progressBar);
popuMenu.inflate(R.menu.bottom_nav_menu);
popuMenu.show();
}
},100);