将此方法添加到我的类时出现此错误:
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
// Inflate your menu.
getSupportMenuInflater().inflate(R.menu.share_action_provider, menu);
// Set file with share history to the provider and set the share intent.
MenuItem actionItem = menu.findItem(R.id.menu_item_share_action_provider_action_bar);
ShareActionProvider actionProvider = (ShareActionProvider) actionItem.getActionProvider();
//actionProvider.setShareHistoryFileName(ShareActionProvider.DEFAULT_SHARE_HISTORY_FILE_NAME);
// Note that you can set/change the intent any time,
// say when the user has selected an image.
actionProvider.setShareIntent(createShareIntent());
return true;
}
这是我声明类的方式:
public class MainActivity extends SherlockActivity implements ActionBar.OnNavigationListener
我在其他项目中也有这种方法,但我没有得到那个错误。有谁知道为什么这个错误开始发生在这里?
谢谢!