Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Items not showing when internet is not connected #53

Closed
gssinghgautam opened this issue Jan 3, 2017 · 8 comments
Closed

Items not showing when internet is not connected #53

gssinghgautam opened this issue Jan 3, 2017 · 8 comments

Comments

@gssinghgautam
Copy link

items in recyclerview not showing when internet is on or availabe, its working fine when internet is available

@gssinghgautam
Copy link
Author

can you please help me regarding this

@sunilsunny565
Copy link

I am also having this issue .Any update on this . ?

@sunilsunny565
Copy link

sunilsunny565 commented Jan 19, 2017

For me the issue was inside AdmobFetcherExpress if the add is failed to load then the parent view visibilty was set as gone. like this

 if(adViewEx.getAdView().getParent()!=null)
            ((View) adViewEx.getAdView().getParent()).setVisibility(View.GONE); 

I have changed this to this

  if(adViewEx.getAdView() !=null)
             adViewEx.getAdView().setVisibility(View.GONE); 

So that only the adview visibily is gone.

@diabloo
Copy link

diabloo commented Jan 20, 2017

same issue , any solution for this ?

@sunilsunny565
Copy link

sunilsunny565 commented Jan 21, 2017

@diabloo Did you tried my workaround ?. Or you can add the adView to a Realative or Linear Layout so that only it's parent's visibility will be gone.

@kot331107
Copy link
Contributor

Guys, I'll check it today.

@diabloo
Copy link

diabloo commented Jan 21, 2017

@sunilsunny565 i tried it but the application crash
java.lang.IllegalStateException: The content of the adapter has changed but ListView did not receive a notification. Make sure the content of your adapter is not modified from a background thread, but only from the UI thread. Make sure your adapter calls notifyDataSetChanged() when its content changes.

edit
this line in AdmobFetcherExpress#onFailedToLoad causes the crash :
mPrefetchedAds.remove(adViewEx);

@sunilsunny565
Copy link

sunilsunny565 commented Jan 23, 2017

@kot331107 Thanks it's working in the latest build.Only one issue an empty view will be there as long as the ad fails. I tried something like this in AdmobExpressAdapterWrapper to get rid of the problem .

   @Override
    public View getView(int position, View convertView, ViewGroup parent) {
      if(getItemViewType(position) == getViewTypeAdExpress() && isNetworkAvailable)
        {
         // rest of code
        return wrapper;
        }else{
          //rest of code
        return mAdapter.getView(origPos, convertView, parent);
       }
  }

That is make a network check on getView ,but in this case I am getting duplicate view of listItem on ad position for sometime and then it disappears.Is there a way to get rid off that empty cell ?. Is there a way to add the view only if the ad is loaded.?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants