How do i call the function from inside onCreate()...I want to call CreateSharedactionprovider() from oncreate() but the app crashes...Am i not calling the function correctly or missing some arguements
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_camera);
// Show the Up button in the action bar.
setupActionBar();
CreateSharedactionprovider();
}
@TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH)
public boolean CreateSharedactionprovider(Menu menu){
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
// Locate MenuItem with ShareActionProvider
MenuItem item = menu.findItem(R.id.menu_share);
// Fetch and store ShareActionProvider
mShareActionProvider = (ShareActionProvider) item.getActionProvider();
doShare();
}
return true;
}