@Override
  public void onResume() {
    super.onResume();
    ((SECBBaseActivity) getActivity()).addBackObserver(this);

    ((SECBBaseActivity) getActivity()).showFilterButton(Utilities.isTablet(getActivity()));

    if (Utilities.isTablet(getActivity())) {
      ((SECBBaseActivity) getActivity()).disableHeaderBackButton();
      ((SECBBaseActivity) getActivity()).enableHeaderMenuButton();
      ((SECBBaseActivity) getActivity()).setHeaderTitleText(getString(R.string.eguide));
    } else {
      ((SECBBaseActivity) getActivity()).addBackObserver(this);
      ((SECBBaseActivity) getActivity()).enableHeaderBackButton(this);
      ((SECBBaseActivity) getActivity()).disableHeaderMenuButton();
      ((SECBBaseActivity) getActivity()).setHeaderTitleText(getString(R.string.organizer_details));
    }
  }
  @Override
  public void onResume() {
    super.onResume();
    ((SECBBaseActivity) getActivity()).addBackObserver(this);
    ((SECBBaseActivity) getActivity()).setHeaderTitleText(getString(R.string.news_details));
    ((SECBBaseActivity) getActivity()).enableHeaderBackButton(this);
    ((SECBBaseActivity) getActivity()).disableHeaderMenuButton();

    ((SECBBaseActivity) getActivity()).showFilterButton(Utilities.isTablet(getActivity()));

    if (Utilities.isTablet(getActivity()) && ((NewsActivity) getActivity()).isDoublePane) {
      ((SECBBaseActivity) getActivity()).setHeaderTitleText(getString(R.string.news));
      ((SECBBaseActivity) getActivity()).disableHeaderBackButton();
      ((SECBBaseActivity) getActivity()).enableHeaderMenuButton();
    } else {
      ((SECBBaseActivity) getActivity()).enableHeaderShareButton(newsItem);
    }
  }
  private void goBack() {
    String backStateName = this.getClass().getName();
    //     ((SECBBaseActivity) getActivity()).finishFragmentOrActivity();

    /*((SECBBaseActivity) getActivity()).finishFragmentOrActivity(backStateName);*/
    if (((NewsActivity) getActivity()).isComingFromMenu && !Utilities.isTablet(getActivity()))
      ((SECBBaseActivity) getActivity()).finishFragmentOrActivity(backStateName);
    else (getActivity()).finish();
  }
  private void bindViews() {
    if (this.newsItem != null) {
      ((SECBBaseActivity) getActivity()).enableHeaderShareButton(newsItem);
      layout_detailsContainer.setVisibility(View.VISIBLE);
      txtv_noData.setVisibility(View.GONE);

      txtv_news_details_newTitle.setText(newsItem.Title);

      //	        String new_day =
      // MainActivity.reFormatNewsDate(newsItem.CreationDate,MainActivity.sdf_Time);
      Date date = null;
      String new_day = "";
      try {
        date = MainActivity.sdf_Source_News.parse(newsItem.CreationDate);
      } catch (ParseException e) {
        e.printStackTrace();
      }
      if (date != null) {
        new_day = MainActivity.sdf_day_MONTH_year.format(date);
      }

      txtv_news_details_newDate.setText(new_day);
      String decodedBody = Uri.decode(newsItem.NewsBody);
      txtv_news_details_newBody.setText(
          !Utilities.isNullString(decodedBody) ? Html.fromHtml(decodedBody) : "");

      if (!Utilities.isNullString(newsItem.ImageUrl)) {
        //		        Picasso.with(getActivity())
        //				        .load(newsItem.ImageUrl)
        //				        .placeholder(R.drawable.news_image_place_holder)
        //				        .into(imgv_news_details_img);
        Glide.with(getActivity())
            .load(newsItem.ImageUrl)
            .placeholder(R.drawable.news_placeholder)
            .centerCrop()
            .into(imgv_news_details_img);
      } else imgv_news_details_img.setImageResource(R.drawable.news_placeholder);
    } else {
      layout_detailsContainer.setVisibility(View.GONE);
      txtv_noData.setText(getResources().getString(R.string.details_no_details));
      txtv_noData.setVisibility(View.VISIBLE);
    }
  }
  private void bindViews() {
    if (this.organizerItem != null) {
      if (!Utilities.isNullString(organizerItem.OrganizerImage)) {
        Glide.with(getActivity())
            .load(organizerItem.OrganizerImage)
            .centerCrop()
            .placeholder(R.drawable.organizer_place_holder)
            .into(imgv_organizerImg);
      } else imgv_organizerImg.setImageResource(R.drawable.organizer_place_holder);

      txtv_organizerName.setText(organizerItem.OrganizerName);
      txtv_organizer_address_value.setText(organizerItem.OrganizerAddressDescription);
      txtv_organizer_phone_value.setText(organizerItem.OrganizerPhone);
      txtv_organizer_email_value.setText(organizerItem.OrganizerEmail);
      txtv_organizer_website_value.setText(organizerItem.OrganizerWebAddress);
    }
  }
  public void updateEventsList(ArrayList<EventItem> eventsList) {

    this.eventsList = eventsList;
    first3EventsList = new ArrayList<>();
    if (eventsList != null && eventsList.size() > 0) {
      for (int i = 0; i < eventsList.size(); i++) {
        first3EventsList.add(eventsList.get(i));
        if (i == 2) break;
      }

      if (Utilities.isTablet(this)
          && eventsList != null
          && eventsList.size() > 3
          && txtv_viewAllEvents != null) txtv_viewAllEvents.setVisibility(View.VISIBLE);
      else txtv_viewAllEvents.setVisibility(View.GONE);
    }

    openEventsListFragment(first3EventsList);
  }
 private void openOrganizerWebsite() {
   if (organizerItem != null && !Utilities.isNullString(organizerItem.OrganizerWebAddress))
     Utilities.openUrlInBrowser(getActivity(), organizerItem.OrganizerWebAddress);
 }
 private void callOrganizerPhone() {
   if (organizerItem != null && !Utilities.isNullString(organizerItem.OrganizerPhone))
     Utilities.callPhoneNumber(getActivity(), organizerItem.OrganizerPhone);
 }
 private void sendOrganizerEmail() {
   if (organizerItem != null && !Utilities.isNullString(organizerItem.OrganizerEmail))
     Utilities.openEmail(getActivity(), organizerItem.OrganizerEmail, "", "");
 }
 private void goBack() {
   String backStateName = this.getClass().getName();
   //     ((SECBBaseActivity) getActivity()).finishFragmentOrActivity();
   if (Utilities.isTablet(getActivity())) (getActivity()).finish();
   else ((SECBBaseActivity) getActivity()).finishFragmentOrActivity(backStateName);
 }