@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); mVolleyRequestQueue = Volley.newRequestQueue(getActivity()); intilizeStatic(); mMovieAdapter = new MovieAdapter(getActivity(), null, 0); trailerDataModified.set(false); reviewDataModified.set(false); movieDetailsModified.set(false); movieMinutesModified.set(false); if (savedInstanceState != null) { synchronized (mMovieId) { mMovieId = savedInstanceState.getLong(sMovieIdKey); YouTubeFirstTrailerURL = savedInstanceState.getParcelable("ShareYoutubeLinkKey"); if (YouTubeFirstTrailerURL != null) if (mShareActionProvider != null) { mMenu.findItem(R.id.action_share).setVisible(true); } else Log.e(LOG_TAG, "mShareActionProvider not set"); try { mMovieId.notifyAll(); } catch (IllegalMonitorStateException x) { } } Bundle b = new Bundle(); b.putLong(sMovieIdKey, mMovieId); getLoaderManager().restartLoader(MovieQuery.DETAIL_LOADER, b, this); getLoaderManager().restartLoader(TrailerQuery.TRAILER_LOADER, b, this); getLoaderManager().restartLoader(ReviewQuery.REVIEW_LOADER, b, this); } }
private void runFragment() { if (mMovieId == Long.MIN_VALUE) synchronized (mMovieId) { Bundle args = getArguments(); mMovieId = args == null ? getActivity().getIntent().getLongExtra(sMovieIdKey, Long.MIN_VALUE) : args.getLong(DetailActivityFragment.MOVIE_ID_KEY); try { mMovieId.notifyAll(); } catch (IllegalMonitorStateException x) { } Bundle b = new Bundle(); b.putLong(sMovieIdKey, mMovieId); getLoaderManager().initLoader(MovieQuery.DETAIL_LOADER, b, this); getLoaderManager().initLoader(TrailerQuery.TRAILER_LOADER, b, this); getLoaderManager().initLoader(ReviewQuery.REVIEW_LOADER, b, this); } }