protected override void OnCreate (Bundle bundle) { base.OnCreate (bundle); SetContentView (Resource.Layout.search_layout); listFavoriteActivity = this; isLoading = false; hideHeading (); specListView = FindViewById<ListView> (Resource.Id.search_list_result); specListView.ItemClick += OnListItemClick; tvSearchResult = FindViewById<TextView> (Resource.Id.tv_noresult_search); tvSearchResult.Text = GetString(Resource.String.no_favorite_title); tvSearchResult.Visibility = ViewStates.Gone; var viewSearch = FindViewById<View> (Resource.Id.viewSearch); llProgress = FindViewById<LinearLayout> (Resource.Id.llProgressBar); llProgress.Visibility = ViewStates.Gone; viewSearch.Visibility = ViewStates.Gone; SearchView searchView = FindViewById<SearchView> (Resource.Id.searchView); searchView.Visibility = ViewStates.Gone; getListFavorite = null; //getFavorite (); TCNotificationCenter.defaultCenter.addObserver (this, constants.kAddFavoriteSuccess, new TCSelector(onAddOrRemoveFavoriteSuccess)); TCNotificationCenter.defaultCenter.addObserver (this, constants.kRemoveFavoriteSuccess, new TCSelector (onAddOrRemoveFavoriteSuccess)); }
public static void getFavorite(bool isFromTabHome){ if (!isFromTabHome) { isLoading = false; } if (isLoading) { return; } if (getListFavorite == null) { getListFavorite = new GetListFavorites (listFavoriteActivity); getListFavorite.actionListFavoriteDelegate = listFavoriteActivity; } getListFavorite.getListFavorite (); }