Ejemplo n.º 1
0
  @Override
  public void onResume() {
    super.onResume();
    getActivity()
        .registerReceiver(mReceiver, new IntentFilter(DownloadMemberService.DOWNLOAD_MEMBER));
    getActivity()
        .registerReceiver(
            mNetworkChangeReceiver, new IntentFilter(NetworkChangeReceiver.INTERNET_IS_CONNECTED));

    if (mMemberAdapter != null && NetworkUtils.isInternetConnected(getActivity())) {
      mMemberAdapter
          .notifyDataSetChanged(); // it should worked when we back to activity and example bitmap
                                   // for avatar is not load
    }
  }
Ejemplo n.º 2
0
 @Override
 public void onReceive(Context context, Intent intent) {
   String action = intent.getAction();
   if (action.equals(NetworkChangeReceiver.INTERNET_IS_CONNECTED)) {
     MembersSQLHelper membersSQLHelper = new MembersSQLHelper(context);
     if (!membersSQLHelper.isMembersExist()) {
       if (!Utility.isMyServiceRunning(context, DownloadMemberService.class)) {
         startDownloadMember();
       }
     } else {
       if (mMemberAdapter != null) {
         mMemberAdapter.notifyDataSetChanged();
       }
     }
   }
 }