android无法在appcompat23.3.0中导入actionmenupresenter

时间:2016-04-12 03:31:36

标签: android android-appcompat

旧build.gralde

compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support:design:22.2.0'

当我将appcompat更新为latset版本[23.3.0]时:

compile 'com.android.support:recyclerview-v7:23.3.0'
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'

mToolbar.setMenu(mb, new ActionMenuPresenter(getActivity()));

ActionMenuPresenter无法解决。

我找到了ActionMenuPresenter

的源代码
class ActionMenuPresenter extends BaseMenuPresenter
        implements ActionProvider.SubUiVisibilityListener {

    private static final String TAG = "ActionMenuPresenter";
    private OverflowMenuButton mOverflowButton;
    private Drawable mPendingOverflowIcon;
}

套餐为default而非public

请帮帮我!!如何解决错误。

EDIT:

我找到了解决这个问题的解决方案:

mToolbar.setOnMenuItemClickListener(
     new Toolbar.OnMenuItemClickListener() {
            @Override
            public boolean onMenuItemClick(MenuItem item) {
                return onToolBarOptionsItemSelected(item, 
                      mToolbar.getMenu());
            }
});

0 个答案:

没有答案