使用 ShowCaseView 定位操作栏菜单项

Targeting action bar menu items with ShowCaseView

如何使用 ShowCaseView.

定位操作栏菜单项

我尝试使用位于 here 的以下代码,我得到 ITEM_ACTION_ITEM cannot be resolved or is not a field

如何使用 ShowCaseView 定位特定的 ActionBar 菜单项?谢谢

        ShowcaseView sv = ShowcaseView.insertShowcaseViewWithType(ShowcaseView.ITEM_ACTION_ITEM,
            R.id.answers, FragmentViewNovice.this,"Edit", 
           "Click here to edit image.");    

对于未来的 Google 员工,我找到了答案。

new ShowcaseView.Builder(getActivity())
    .setTarget(new ActionItemTarget(getActivity(), R.id.answers)) //Here is where you supply the id of the action bar item you want to display
    .setContentTitle("Title")
    .setContentText("Description")
    .hideOnTouchOutside()
    .build();