You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have added the lambda, and then ? what do I have to do to make it works ? Thanks
My actual java code is :
private void initMenuFragment() {
MenuParams menuParams = new MenuParams();
menuParams.setActionBarSize((int) getResources().getDimension(R.dimen.tool_bar_height));
menuParams.setMenuObjects(getMenuObjects());
menuParams.setClosableOutside(false); // permet de fermer le menu en cliquant sur une zone sans bouton
mMenuDialogFragment = ContextMenuDialogFragment.newInstance(menuParams);
mMenuDialogFragment.setItemClickListener(this);
}
private List<MenuObject> getMenuObjects() {
List<MenuObject> menuObjects = new ArrayList<>();
MenuObject close = new MenuObject();
close.setResource(R.drawable.ic_close);
MenuObject cam = new MenuObject("LIVE CAMERAS");
cam.setMenuTextAppearanceStyle(R.style.Context_Menu);
cam.setResource(R.drawable.ic_camera);
menuObjects.add(close);
menuObjects.add(cam);
return menuObjects;
}
@Override
public void onMenuItemClick(View clickedView, int position) {
if (position == 1) {
//
} else if (position == 2) {
//
}
}
How I can implement menu item click on java? Which parameter type I should provide to setMenuItemClickListener method
He show me the tint:
Required type: Function2
What is it?
If I try to provide
this
with implemented:MenuItem.OnMenuItemClickListener
interface, I get such error:The text was updated successfully, but these errors were encountered: