1

Menu item null when calling method in fragment from activity

view story
linux-howto

http://stackoverflow.com – My app uses a ViewPager in portrait mode and a dual-fragment layout in landscape. I am trying to kick off an AsyncTask, that is in the Fragment, from Activity. The AsyncTask is normally started from a menu item in the Actionbar, but I have a need to start it programatically from the Activity. The menu item is an ImageView and I'm animating it while the AsyncTask is running. The code I have works fine in the dual-fragment landscape view, but I'm getting a NullPointerException on the menu item when in portrait mode. Activity public class Main extends SherlockFragmentActivity { private (HowTos)