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 void ReloadFromArguments(Bundle arguments)
        {
            // Teardown from previous arguments
            if (mCursor != null)
            {
                Activity.StopManagingCursor(mCursor);
                mCursor = null;
            }

            mCheckedPosition = -1;
            ListAdapter      = null;

            mHandler.CancelOperation(SearchQuery._TOKEN);
            mHandler.CancelOperation(SessionsQuery._TOKEN);
            mHandler.CancelOperation(TracksQuery._TOKEN);

            // Load new arguments
            Intent intent      = BaseActivity.FragmentArgumentsToIntent(arguments);
            Uri    sessionsUri = intent.Data;
            int    sessionQueryToken;

            if (sessionsUri == null)
            {
                return;
            }

            String[] projection;
            if (!ScheduleContract.Sessions.IsSearchUri(sessionsUri))
            {
                mAdapter          = new SessionsAdapter(Activity, this);
                projection        = SessionsQuery.PROJECTION;
                sessionQueryToken = SessionsQuery._TOKEN;
            }
            else
            {
                mAdapter          = new SearchAdapter(Activity, this);
                projection        = SearchQuery.PROJECTION;
                sessionQueryToken = SearchQuery._TOKEN;
            }

            ListAdapter = mAdapter;

            // Start background query to load sessions
            mHandler.StartQuery(sessionQueryToken, null, sessionsUri, projection, null, null, ScheduleContract.Sessions.DEFAULT_SORT);

            // If caller launched us with specific track hint, pass it along when
            // launching session details. Also start a query to load the track info.
            mTrackUri = (Android.Net.Uri)intent.GetParcelableExtra(SessionDetailFragment.EXTRA_TRACK);
            mTrackUri = null;
            if (mTrackUri != null)
            {
                mHandler.StartQuery(TracksQuery._TOKEN, mTrackUri, TracksQuery.PROJECTION);
            }
        }
예제 #3
0
        public override void OnCreate(Bundle p0)
        {
            base.OnCreate(p0);

            Intent intent = BaseActivity.FragmentArgumentsToIntent(Arguments);

            mVendorUri = intent.Data;
            if (mVendorUri == null)
            {
                return;
            }

            SetHasOptionsMenu(true);
        }
        public void ReloadFromArguments(Bundle arguments)
        {
            // Teardown from previous arguments
            if (mListPopupWindow != null)
            {
                mListPopupWindow.SetAdapter(null);
            }
            if (mCursor != null)
            {
                Activity.StopManagingCursor(mCursor);
                mCursor = null;
            }
            mHandler.CancelOperation(TracksAdapter.TracksQuery._TOKEN);

            // Load new arguments
            Intent intent    = BaseActivity.FragmentArgumentsToIntent(arguments);
            Uri    tracksUri = intent.Data;

            if (tracksUri == null)
            {
                return;
            }

            mNextType = intent.GetStringExtra(EXTRA_NEXT_TYPE);

            // Filter our tracks query to only include those with valid results
            String[] projection = TracksAdapter.TracksQuery.PROJECTION;
            String   selection  = null;

            if (TracksFragment.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";
            }
            else if (TracksFragment.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";
            }

            // Start background query to load tracks
            mHandler.StartQuery(TracksAdapter.TracksQuery._TOKEN, null, tracksUri, projection, selection, null, ScheduleContract.Tracks.DEFAULT_SORT);
        }
        public override void OnCreate(Bundle p0)
        {
            base.OnCreate(p0);

            Intent intent = BaseActivity.FragmentArgumentsToIntent(Arguments);

            mSessionUri            = intent.Data;
            mTrackUri              = ResolveTrackUri(intent);
            packageChangesReceiver = new PackageChangesReceiver(this);

            if (mSessionUri == null)
            {
                return;
            }

            mSessionId = ScheduleContract.Sessions.GetSessionId(mSessionUri);

            HasOptionsMenu = true;
        }
예제 #6
0
            public void OnMapReady()
            {
                if (Log.IsLoggable(TAG, LogPriority.Debug))
                {
                    Log.Debug(TAG, "onMapReady");
                }

                Intent intent = BaseActivity.FragmentArgumentsToIntent(_arguments);

                string showRoomId = null;

                if (!mapInitialized && intent.HasExtra(EXTRA_ROOM))
                {
                    showRoomId = intent.GetStringExtra(EXTRA_ROOM);
                }

                if (showRoomId != null)
                {
                    RunJs("IoMap.showLocationById('" + EscapeJsString(showRoomId) + "');");
                }

                mapInitialized = true;
            }