public override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Intent intent = BaseActivity.FragmentArgumentsToIntent(Arguments); Uri tracksUri = intent.Data; mNextType = intent.GetStringExtra(EXTRA_NEXT_TYPE); mAdapter = new TracksAdapter(Activity); ListAdapter = mAdapter; // Filter our tracks query to only include those with valid results String[] projection = TracksAdapter.TracksQuery.PROJECTION; String selection = null; if (NEXT_TYPE_SESSIONS.Equals(mNextType)) { // Only show tracks with at least one session projection = TracksAdapter.TracksQuery.PROJECTION_WITH_SESSIONS_COUNT; selection = ScheduleContract.Tracks.SESSIONS_COUNT + ">0"; //AnalyticsUtils.getInstance(getActivity()).trackPageView("/Tracks"); } else if (NEXT_TYPE_VENDORS.Equals(mNextType)) { // Only show tracks with at least one vendor projection = TracksAdapter.TracksQuery.PROJECTION_WITH_VENDORS_COUNT; selection = ScheduleContract.Tracks.VENDORS_COUNT + ">0"; //AnalyticsUtils.getInstance(getActivity()).trackPageView("/Sandbox"); } // Start background query to load tracks mHandler = new NotifyingAsyncQueryHandler(Activity.ContentResolver, this); mHandler.StartQuery(tracksUri, projection, selection, null, ScheduleContract.Tracks.DEFAULT_SORT); }
public override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); mHandler = new NotifyingAsyncQueryHandler(Activity.ContentResolver, this); mAdapter = new TracksAdapter(Activity); if (savedInstanceState != null) { // Prevent auto-load behavior on orientation change. mAutoloadTarget = false; } ReloadFromArguments(Arguments); }