コード例 #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
ファイル: StoreFragment.cs プロジェクト: puncsky/DrunkAudible
        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
ファイル: StoreFragment.cs プロジェクト: puncsky/DrunkAudible
 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 ()
         );
 }