I am using BottomSheet library setting this method giving me
cannot resolve constructor anonymous MenuItem.OnMenuItemClickListener
Cannot resolve constructor 'MenuSheetView(MyProjectName.....FragmentClassName, com.flipboard.bottomsheet.commons.MenuSheetView.MenuType, java.lang.String, anonymous android.view.MenuItem.OnMenuItemClickListener)'
I am doing it as the same as this library sample
private void TestBS(){
bottomSheet.showWithSheetView(
new MenuSheetView(ViewLesson.this, MenuSheetView.MenuType.LIST, "Create...",
new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
return true;
}
}));
}
Will anyone know from what the error is produced
It just display the error message I have posted
ViewLesson
public class ViewLesson extends Fragment {
private Button CreateBtn;
private TextView DescriptionTV,Header;
private BottomSheetLayout bottomSheet;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
....
fetchData();
return rootview;
}
private void fetchData() {....}
private void TestBS(){
bottomSheet.showWithSheetView(
new MenuSheetView(getContext(), MenuSheetView.MenuType.LIST, "Create...", new MenuItem.OnMenuItemClickListener() {
@Override
public boolean onMenuItemClick(MenuItem item) {
Log.i("dddd","ss");
//Toast.makeText(this, item.getTitle(), Toast.LENGTH_SHORT).show();
if (bottomSheet.isSheetShowing()) {
bottomSheet.dismissSheet();
}
/*if (item.getItemId() == R.id.reopen) {
showMenuSheet(menuType == MenuSheetView.MenuType.LIST ? MenuSheetView.MenuType.GRID : MenuSheetView.MenuType.LIST);
}*/
return true;
}
}));
}
}
getActivity()
or getActivity().getApplicationContext()
is not working also
Cannot resolve constructor 'MenuSheetView(android.content.Context, com.flipboard.bottomsheet.commons.MenuSheetView.MenuType, java.lang.String, anonymous android.view.MenuItem.OnMenuItemClickListener)'
Any suggestions, any solutions?