예제 #1
0
        public override void OnActivityCreated(Bundle savedInstanceState)
        {
            base.OnActivityCreated(savedInstanceState);

            if (_albums != null)
            {
                ListAdapter = new StoreListAdapter(Activity, _albums);
            }
            else if (!_isGettingRemoteAlbums)
            {
                GetRemoteAlbumsAsync();
            }
        }
예제 #2
0
        public override void OnActivityCreated (Bundle savedInstanceState)
        {
            base.OnActivityCreated (savedInstanceState);

            if (_albums != null)
            {
                ListAdapter = new StoreListAdapter (Activity, _albums);
            }
            else if (!_isGettingRemoteAlbums)
            {
                GetRemoteAlbumsAsync ();
            }
        }
예제 #3
0
 void GetRemoteAlbumsAsync()
 {
     Task.Factory
     .StartNew(() => GetRemoteAlbums())
     .ContinueWith(t =>
     {
         if (!t.IsFaulted && t.Result != null && Activity != null)
         {
             _albums     = t.Result;
             ListAdapter = new StoreListAdapter(Activity, _albums);
         }
         _isGettingRemoteAlbums = false;
     },
                   TaskScheduler.FromCurrentSynchronizationContext()
                   );
 }
예제 #4
0
 void GetRemoteAlbumsAsync ()
 {
     Task.Factory
         .StartNew (() => GetRemoteAlbums ())
         .ContinueWith (t =>
             {
                 if (!t.IsFaulted && t.Result != null && Activity != null)
                 {
                     _albums = t.Result;
                     ListAdapter = new StoreListAdapter (Activity, _albums);
                 }
                 _isGettingRemoteAlbums = false;
             },
             TaskScheduler.FromCurrentSynchronizationContext ()
         );
 }