Android - Are these values normal for an app?Is there a way to run Python on Android?Which “href” value should I use for JavaScript links, “#” or “javascript:void(0)”?How do save an Android Activity state using save instance state?Activity restart on rotation AndroidClose/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?“Debug certificate expired” error in Eclipse Android pluginsIs there a unique Android device ID?What is 'Context' on Android?Proper use cases for Android UserManager.isUserAGoat()?
Earliest use of "rookie"?
What is the best way for a skeleton to impersonate human without using magic?
What information do scammers need to withdraw money from an account?
Replace all items that are not belong to characters and numbers by ' '
How can a vertex have a normal?
How can a layman easily get the consensus view of what academia *thinks* about a subject?
On what legal basis did the UK remove the 'European Union' from its passport?
Why does the Earth follow an elliptical trajectory rather than a parabolic one?
If current results hold, Man City would win PL title
Interior smooth regularity
correct spelling of "carruffel" (fuzz, hustle, all that jazz)
Ito`s Lemma problem
How do employ ' ("prime") in math mode at the correct depth?
Why is it harder to turn a motor/generator with shorted terminals?
As programers say: Strive to be lazy
Ex-manager wants to stay in touch, I don't want to
Would an 8% reduction in drag outweigh the weight addition from this custom CFD-tested winglet?
Unbounded Fredholms operators
Why are solar panels kept tilted?
using `is` operator with value type tuples gives error
Centering subcaptions in a tikz pgfplot subfigure environment?
What is the largest number of identical satellites launched together?
What are the implications of the new alleged key recovery attack preprint on SIMON?
How does emacs `shell-mode` know to prompt for sudo?
Android - Are these values normal for an app?
Is there a way to run Python on Android?Which “href” value should I use for JavaScript links, “#” or “javascript:void(0)”?How do save an Android Activity state using save instance state?Activity restart on rotation AndroidClose/hide the Android Soft KeyboardWhy is the Android emulator so slow? How can we speed up the Android emulator?“Debug certificate expired” error in Eclipse Android pluginsIs there a unique Android device ID?What is 'Context' on Android?Proper use cases for Android UserManager.isUserAGoat()?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I need to say i'm very new to android. Lately in my recycler view when i load over 100 items (mostly pictures) my app first lags then closes itself without error message. These are profiler values. What i want to know is are these values normal? if not what is normal value. I guess i need to mention that this is sharing app like facebook.



My adapter code:
if(list.get(position).getPost().getTogroup()!=null)
holder.groupname.setText(list.get(position).getPost().getTogroup());
holder.profilephoto.setVisibility(View.VISIBLE);
holder.namebelow.setVisibility(View.VISIBLE);
holder.groupname.setVisibility(View.VISIBLE);
holder.usernamebelow.setVisibility(View.VISIBLE);
Glide.with(holder.itemView.getContext()).load(list.get(position).getPost().getGroupppurl()).into(holder.profilephoto);
holder.namebelow.setText(list.get(position).getUser().getNamesurname());
holder.usernamebelow.setText("(@"+list.get(position).getUser().getUsername()+")");
if(list.get(position).getPost().getType().equals("text"))
if(!list.get(position).getPost().getDescription().equals(""))
holder.descrition.setText(list.get(position).getPost().getDescription());
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("link"))
holder.linkpreview.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getUrl();
String linkimageurl=list.get(position).getPost().getLinkimageurl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(linkimageurl).into(holder.linkimage);
String linktitle=list.get(position).getPost().getLinktitle();
holder.linktitle.setText(linktitle);
String linkdesc = list.get(position).getPost().getLinkdesc();
holder.linkdesc.setText(linkdesc);
holder.linkurl.setText(url);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("image"))
float iratio = list.get(position).getPost().getImageratio();
holder.imagelayout.setVisibility(View.VISIBLE);
holder.postimage.setRatio(iratio);
String url=list.get(position).getPost().getUrl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).addListener(new RequestListener<Drawable>()
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource)
return false;
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource)
holder.imageloadingbar.setVisibility(View.INVISIBLE);
return false;
).into(holder.postimage);
String description = list.get(position).getPost().getDescription();;
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("video"))
holder.videoplayerjz.widthRatio=1;
holder.videoplayerjz.heightRatio=1;
holder.videoplayerjz.fullscreenButton.setVisibility(View.GONE);
holder.videoplayerjz.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getThumburl();
holder.videoplayerjz.setUp(
list.get(position).getPost().getUrl(),
"", Jzvd.SCREEN_WINDOW_LIST);
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).into(holder.videoplayerjz.thumbImageView);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getTogroup()==null)
holder.profilephoto.setVisibility(View.VISIBLE);
holder.namecenter.setVisibility(View.VISIBLE);
holder.usernamecenter.setVisibility(View.VISIBLE);
Glide.with(holder.itemView.getContext()).load(list.get(position).getUser().getProfilephotourl()).into(holder.profilephoto);
holder.namecenter.setText(list.get(position).getUser().getNamesurname());
holder.usernamecenter.setText("(@"+list.get(position).getUser().getUsername()+")");
if(list.get(position).getPost().getType().equals("text"))
if(!list.get(position).getPost().getDescription().equals(""))
holder.descrition.setText(list.get(position).getPost().getDescription());
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("link"))
holder.linkpreview.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getUrl();
String linkimageurl=list.get(position).getPost().getLinkimageurl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(linkimageurl).into(holder.linkimage);
String linktitle=list.get(position).getPost().getLinktitle();
holder.linktitle.setText(linktitle);
String linkdesc = list.get(position).getPost().getLinkdesc();
holder.linkdesc.setText(linkdesc);
holder.linkurl.setText(url);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("image"))
float iratio = list.get(position).getPost().getImageratio();
holder.imagelayout.setVisibility(View.VISIBLE);
holder.postimage.setRatio(iratio);
String url=list.get(position).getPost().getUrl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).addListener(new RequestListener<Drawable>()
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource)
return false;
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource)
holder.imageloadingbar.setVisibility(View.INVISIBLE);
return false;
).into(holder.postimage);
String description = list.get(position).getPost().getDescription();;
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("video"))
holder.videoplayerjz.widthRatio=1;
holder.videoplayerjz.heightRatio=1;
holder.videoplayerjz.fullscreenButton.setVisibility(View.GONE);
holder.videoplayerjz.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getThumburl();
holder.videoplayerjz.setUp(
list.get(position).getPost().getUrl(),
"", Jzvd.SCREEN_WINDOW_LIST);
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).into(holder.videoplayerjz.thumbImageView);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
add a comment |
I need to say i'm very new to android. Lately in my recycler view when i load over 100 items (mostly pictures) my app first lags then closes itself without error message. These are profiler values. What i want to know is are these values normal? if not what is normal value. I guess i need to mention that this is sharing app like facebook.



My adapter code:
if(list.get(position).getPost().getTogroup()!=null)
holder.groupname.setText(list.get(position).getPost().getTogroup());
holder.profilephoto.setVisibility(View.VISIBLE);
holder.namebelow.setVisibility(View.VISIBLE);
holder.groupname.setVisibility(View.VISIBLE);
holder.usernamebelow.setVisibility(View.VISIBLE);
Glide.with(holder.itemView.getContext()).load(list.get(position).getPost().getGroupppurl()).into(holder.profilephoto);
holder.namebelow.setText(list.get(position).getUser().getNamesurname());
holder.usernamebelow.setText("(@"+list.get(position).getUser().getUsername()+")");
if(list.get(position).getPost().getType().equals("text"))
if(!list.get(position).getPost().getDescription().equals(""))
holder.descrition.setText(list.get(position).getPost().getDescription());
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("link"))
holder.linkpreview.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getUrl();
String linkimageurl=list.get(position).getPost().getLinkimageurl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(linkimageurl).into(holder.linkimage);
String linktitle=list.get(position).getPost().getLinktitle();
holder.linktitle.setText(linktitle);
String linkdesc = list.get(position).getPost().getLinkdesc();
holder.linkdesc.setText(linkdesc);
holder.linkurl.setText(url);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("image"))
float iratio = list.get(position).getPost().getImageratio();
holder.imagelayout.setVisibility(View.VISIBLE);
holder.postimage.setRatio(iratio);
String url=list.get(position).getPost().getUrl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).addListener(new RequestListener<Drawable>()
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource)
return false;
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource)
holder.imageloadingbar.setVisibility(View.INVISIBLE);
return false;
).into(holder.postimage);
String description = list.get(position).getPost().getDescription();;
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("video"))
holder.videoplayerjz.widthRatio=1;
holder.videoplayerjz.heightRatio=1;
holder.videoplayerjz.fullscreenButton.setVisibility(View.GONE);
holder.videoplayerjz.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getThumburl();
holder.videoplayerjz.setUp(
list.get(position).getPost().getUrl(),
"", Jzvd.SCREEN_WINDOW_LIST);
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).into(holder.videoplayerjz.thumbImageView);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getTogroup()==null)
holder.profilephoto.setVisibility(View.VISIBLE);
holder.namecenter.setVisibility(View.VISIBLE);
holder.usernamecenter.setVisibility(View.VISIBLE);
Glide.with(holder.itemView.getContext()).load(list.get(position).getUser().getProfilephotourl()).into(holder.profilephoto);
holder.namecenter.setText(list.get(position).getUser().getNamesurname());
holder.usernamecenter.setText("(@"+list.get(position).getUser().getUsername()+")");
if(list.get(position).getPost().getType().equals("text"))
if(!list.get(position).getPost().getDescription().equals(""))
holder.descrition.setText(list.get(position).getPost().getDescription());
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("link"))
holder.linkpreview.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getUrl();
String linkimageurl=list.get(position).getPost().getLinkimageurl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(linkimageurl).into(holder.linkimage);
String linktitle=list.get(position).getPost().getLinktitle();
holder.linktitle.setText(linktitle);
String linkdesc = list.get(position).getPost().getLinkdesc();
holder.linkdesc.setText(linkdesc);
holder.linkurl.setText(url);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("image"))
float iratio = list.get(position).getPost().getImageratio();
holder.imagelayout.setVisibility(View.VISIBLE);
holder.postimage.setRatio(iratio);
String url=list.get(position).getPost().getUrl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).addListener(new RequestListener<Drawable>()
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource)
return false;
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource)
holder.imageloadingbar.setVisibility(View.INVISIBLE);
return false;
).into(holder.postimage);
String description = list.get(position).getPost().getDescription();;
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("video"))
holder.videoplayerjz.widthRatio=1;
holder.videoplayerjz.heightRatio=1;
holder.videoplayerjz.fullscreenButton.setVisibility(View.GONE);
holder.videoplayerjz.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getThumburl();
holder.videoplayerjz.setUp(
list.get(position).getPost().getUrl(),
"", Jzvd.SCREEN_WINDOW_LIST);
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).into(holder.videoplayerjz.thumbImageView);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
Do you load your image from Internet or local(res)? And may you show your adapter when you put to the image to imageview or other views then we can see if it is memory issue or others since you mentioned it lags
– CbL
Mar 23 at 14:15
I have added my adapter code @CbL
– UzaySan
Mar 24 at 11:59
@CbL Also i have to mention that app also sometimes crashes due to oom
– UzaySan
Mar 24 at 12:01
I read the code you provided. I suggest you try to clear the imagelayout and videoplayerjz. As you try to request the image into that view when scrolling, some of the unseen imageview will be cache on the memory, this may cause the memory usage too heavy. You may try call Glide clear() in onViewRecycled see if this may improve the performance.
– CbL
Mar 28 at 12:44
Glide recycle may ref bumptech.github.io/glide/doc/…
– CbL
Mar 28 at 12:44
add a comment |
I need to say i'm very new to android. Lately in my recycler view when i load over 100 items (mostly pictures) my app first lags then closes itself without error message. These are profiler values. What i want to know is are these values normal? if not what is normal value. I guess i need to mention that this is sharing app like facebook.



My adapter code:
if(list.get(position).getPost().getTogroup()!=null)
holder.groupname.setText(list.get(position).getPost().getTogroup());
holder.profilephoto.setVisibility(View.VISIBLE);
holder.namebelow.setVisibility(View.VISIBLE);
holder.groupname.setVisibility(View.VISIBLE);
holder.usernamebelow.setVisibility(View.VISIBLE);
Glide.with(holder.itemView.getContext()).load(list.get(position).getPost().getGroupppurl()).into(holder.profilephoto);
holder.namebelow.setText(list.get(position).getUser().getNamesurname());
holder.usernamebelow.setText("(@"+list.get(position).getUser().getUsername()+")");
if(list.get(position).getPost().getType().equals("text"))
if(!list.get(position).getPost().getDescription().equals(""))
holder.descrition.setText(list.get(position).getPost().getDescription());
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("link"))
holder.linkpreview.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getUrl();
String linkimageurl=list.get(position).getPost().getLinkimageurl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(linkimageurl).into(holder.linkimage);
String linktitle=list.get(position).getPost().getLinktitle();
holder.linktitle.setText(linktitle);
String linkdesc = list.get(position).getPost().getLinkdesc();
holder.linkdesc.setText(linkdesc);
holder.linkurl.setText(url);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("image"))
float iratio = list.get(position).getPost().getImageratio();
holder.imagelayout.setVisibility(View.VISIBLE);
holder.postimage.setRatio(iratio);
String url=list.get(position).getPost().getUrl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).addListener(new RequestListener<Drawable>()
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource)
return false;
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource)
holder.imageloadingbar.setVisibility(View.INVISIBLE);
return false;
).into(holder.postimage);
String description = list.get(position).getPost().getDescription();;
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("video"))
holder.videoplayerjz.widthRatio=1;
holder.videoplayerjz.heightRatio=1;
holder.videoplayerjz.fullscreenButton.setVisibility(View.GONE);
holder.videoplayerjz.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getThumburl();
holder.videoplayerjz.setUp(
list.get(position).getPost().getUrl(),
"", Jzvd.SCREEN_WINDOW_LIST);
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).into(holder.videoplayerjz.thumbImageView);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getTogroup()==null)
holder.profilephoto.setVisibility(View.VISIBLE);
holder.namecenter.setVisibility(View.VISIBLE);
holder.usernamecenter.setVisibility(View.VISIBLE);
Glide.with(holder.itemView.getContext()).load(list.get(position).getUser().getProfilephotourl()).into(holder.profilephoto);
holder.namecenter.setText(list.get(position).getUser().getNamesurname());
holder.usernamecenter.setText("(@"+list.get(position).getUser().getUsername()+")");
if(list.get(position).getPost().getType().equals("text"))
if(!list.get(position).getPost().getDescription().equals(""))
holder.descrition.setText(list.get(position).getPost().getDescription());
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("link"))
holder.linkpreview.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getUrl();
String linkimageurl=list.get(position).getPost().getLinkimageurl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(linkimageurl).into(holder.linkimage);
String linktitle=list.get(position).getPost().getLinktitle();
holder.linktitle.setText(linktitle);
String linkdesc = list.get(position).getPost().getLinkdesc();
holder.linkdesc.setText(linkdesc);
holder.linkurl.setText(url);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("image"))
float iratio = list.get(position).getPost().getImageratio();
holder.imagelayout.setVisibility(View.VISIBLE);
holder.postimage.setRatio(iratio);
String url=list.get(position).getPost().getUrl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).addListener(new RequestListener<Drawable>()
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource)
return false;
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource)
holder.imageloadingbar.setVisibility(View.INVISIBLE);
return false;
).into(holder.postimage);
String description = list.get(position).getPost().getDescription();;
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("video"))
holder.videoplayerjz.widthRatio=1;
holder.videoplayerjz.heightRatio=1;
holder.videoplayerjz.fullscreenButton.setVisibility(View.GONE);
holder.videoplayerjz.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getThumburl();
holder.videoplayerjz.setUp(
list.get(position).getPost().getUrl(),
"", Jzvd.SCREEN_WINDOW_LIST);
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).into(holder.videoplayerjz.thumbImageView);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
I need to say i'm very new to android. Lately in my recycler view when i load over 100 items (mostly pictures) my app first lags then closes itself without error message. These are profiler values. What i want to know is are these values normal? if not what is normal value. I guess i need to mention that this is sharing app like facebook.



My adapter code:
if(list.get(position).getPost().getTogroup()!=null)
holder.groupname.setText(list.get(position).getPost().getTogroup());
holder.profilephoto.setVisibility(View.VISIBLE);
holder.namebelow.setVisibility(View.VISIBLE);
holder.groupname.setVisibility(View.VISIBLE);
holder.usernamebelow.setVisibility(View.VISIBLE);
Glide.with(holder.itemView.getContext()).load(list.get(position).getPost().getGroupppurl()).into(holder.profilephoto);
holder.namebelow.setText(list.get(position).getUser().getNamesurname());
holder.usernamebelow.setText("(@"+list.get(position).getUser().getUsername()+")");
if(list.get(position).getPost().getType().equals("text"))
if(!list.get(position).getPost().getDescription().equals(""))
holder.descrition.setText(list.get(position).getPost().getDescription());
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("link"))
holder.linkpreview.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getUrl();
String linkimageurl=list.get(position).getPost().getLinkimageurl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(linkimageurl).into(holder.linkimage);
String linktitle=list.get(position).getPost().getLinktitle();
holder.linktitle.setText(linktitle);
String linkdesc = list.get(position).getPost().getLinkdesc();
holder.linkdesc.setText(linkdesc);
holder.linkurl.setText(url);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("image"))
float iratio = list.get(position).getPost().getImageratio();
holder.imagelayout.setVisibility(View.VISIBLE);
holder.postimage.setRatio(iratio);
String url=list.get(position).getPost().getUrl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).addListener(new RequestListener<Drawable>()
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource)
return false;
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource)
holder.imageloadingbar.setVisibility(View.INVISIBLE);
return false;
).into(holder.postimage);
String description = list.get(position).getPost().getDescription();;
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("video"))
holder.videoplayerjz.widthRatio=1;
holder.videoplayerjz.heightRatio=1;
holder.videoplayerjz.fullscreenButton.setVisibility(View.GONE);
holder.videoplayerjz.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getThumburl();
holder.videoplayerjz.setUp(
list.get(position).getPost().getUrl(),
"", Jzvd.SCREEN_WINDOW_LIST);
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).into(holder.videoplayerjz.thumbImageView);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getTogroup()==null)
holder.profilephoto.setVisibility(View.VISIBLE);
holder.namecenter.setVisibility(View.VISIBLE);
holder.usernamecenter.setVisibility(View.VISIBLE);
Glide.with(holder.itemView.getContext()).load(list.get(position).getUser().getProfilephotourl()).into(holder.profilephoto);
holder.namecenter.setText(list.get(position).getUser().getNamesurname());
holder.usernamecenter.setText("(@"+list.get(position).getUser().getUsername()+")");
if(list.get(position).getPost().getType().equals("text"))
if(!list.get(position).getPost().getDescription().equals(""))
holder.descrition.setText(list.get(position).getPost().getDescription());
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("link"))
holder.linkpreview.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getUrl();
String linkimageurl=list.get(position).getPost().getLinkimageurl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(linkimageurl).into(holder.linkimage);
String linktitle=list.get(position).getPost().getLinktitle();
holder.linktitle.setText(linktitle);
String linkdesc = list.get(position).getPost().getLinkdesc();
holder.linkdesc.setText(linkdesc);
holder.linkurl.setText(url);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("image"))
float iratio = list.get(position).getPost().getImageratio();
holder.imagelayout.setVisibility(View.VISIBLE);
holder.postimage.setRatio(iratio);
String url=list.get(position).getPost().getUrl();
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).addListener(new RequestListener<Drawable>()
@Override
public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Drawable> target, boolean isFirstResource)
return false;
@Override
public boolean onResourceReady(Drawable resource, Object model, Target<Drawable> target, DataSource dataSource, boolean isFirstResource)
holder.imageloadingbar.setVisibility(View.INVISIBLE);
return false;
).into(holder.postimage);
String description = list.get(position).getPost().getDescription();;
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
if(list.get(position).getPost().getType().equals("video"))
holder.videoplayerjz.widthRatio=1;
holder.videoplayerjz.heightRatio=1;
holder.videoplayerjz.fullscreenButton.setVisibility(View.GONE);
holder.videoplayerjz.setVisibility(View.VISIBLE);
String url=list.get(position).getPost().getThumburl();
holder.videoplayerjz.setUp(
list.get(position).getPost().getUrl(),
"", Jzvd.SCREEN_WINDOW_LIST);
if(holder.itemView.getContext()!=null)
Glide.with(holder.itemView.getContext()).load(url).into(holder.videoplayerjz.thumbImageView);
String description = list.get(position).getPost().getDescription();
if(!description.equals(""))
holder.descrition.setText(description);
holder.descrition.setVisibility(View.VISIBLE);
edited Mar 24 at 11:59
UzaySan
asked Mar 23 at 13:05
UzaySanUzaySan
878
878
Do you load your image from Internet or local(res)? And may you show your adapter when you put to the image to imageview or other views then we can see if it is memory issue or others since you mentioned it lags
– CbL
Mar 23 at 14:15
I have added my adapter code @CbL
– UzaySan
Mar 24 at 11:59
@CbL Also i have to mention that app also sometimes crashes due to oom
– UzaySan
Mar 24 at 12:01
I read the code you provided. I suggest you try to clear the imagelayout and videoplayerjz. As you try to request the image into that view when scrolling, some of the unseen imageview will be cache on the memory, this may cause the memory usage too heavy. You may try call Glide clear() in onViewRecycled see if this may improve the performance.
– CbL
Mar 28 at 12:44
Glide recycle may ref bumptech.github.io/glide/doc/…
– CbL
Mar 28 at 12:44
add a comment |
Do you load your image from Internet or local(res)? And may you show your adapter when you put to the image to imageview or other views then we can see if it is memory issue or others since you mentioned it lags
– CbL
Mar 23 at 14:15
I have added my adapter code @CbL
– UzaySan
Mar 24 at 11:59
@CbL Also i have to mention that app also sometimes crashes due to oom
– UzaySan
Mar 24 at 12:01
I read the code you provided. I suggest you try to clear the imagelayout and videoplayerjz. As you try to request the image into that view when scrolling, some of the unseen imageview will be cache on the memory, this may cause the memory usage too heavy. You may try call Glide clear() in onViewRecycled see if this may improve the performance.
– CbL
Mar 28 at 12:44
Glide recycle may ref bumptech.github.io/glide/doc/…
– CbL
Mar 28 at 12:44
Do you load your image from Internet or local(res)? And may you show your adapter when you put to the image to imageview or other views then we can see if it is memory issue or others since you mentioned it lags
– CbL
Mar 23 at 14:15
Do you load your image from Internet or local(res)? And may you show your adapter when you put to the image to imageview or other views then we can see if it is memory issue or others since you mentioned it lags
– CbL
Mar 23 at 14:15
I have added my adapter code @CbL
– UzaySan
Mar 24 at 11:59
I have added my adapter code @CbL
– UzaySan
Mar 24 at 11:59
@CbL Also i have to mention that app also sometimes crashes due to oom
– UzaySan
Mar 24 at 12:01
@CbL Also i have to mention that app also sometimes crashes due to oom
– UzaySan
Mar 24 at 12:01
I read the code you provided. I suggest you try to clear the imagelayout and videoplayerjz. As you try to request the image into that view when scrolling, some of the unseen imageview will be cache on the memory, this may cause the memory usage too heavy. You may try call Glide clear() in onViewRecycled see if this may improve the performance.
– CbL
Mar 28 at 12:44
I read the code you provided. I suggest you try to clear the imagelayout and videoplayerjz. As you try to request the image into that view when scrolling, some of the unseen imageview will be cache on the memory, this may cause the memory usage too heavy. You may try call Glide clear() in onViewRecycled see if this may improve the performance.
– CbL
Mar 28 at 12:44
Glide recycle may ref bumptech.github.io/glide/doc/…
– CbL
Mar 28 at 12:44
Glide recycle may ref bumptech.github.io/glide/doc/…
– CbL
Mar 28 at 12:44
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314011%2fandroid-are-these-values-normal-for-an-app%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55314011%2fandroid-are-these-values-normal-for-an-app%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Do you load your image from Internet or local(res)? And may you show your adapter when you put to the image to imageview or other views then we can see if it is memory issue or others since you mentioned it lags
– CbL
Mar 23 at 14:15
I have added my adapter code @CbL
– UzaySan
Mar 24 at 11:59
@CbL Also i have to mention that app also sometimes crashes due to oom
– UzaySan
Mar 24 at 12:01
I read the code you provided. I suggest you try to clear the imagelayout and videoplayerjz. As you try to request the image into that view when scrolling, some of the unseen imageview will be cache on the memory, this may cause the memory usage too heavy. You may try call Glide clear() in onViewRecycled see if this may improve the performance.
– CbL
Mar 28 at 12:44
Glide recycle may ref bumptech.github.io/glide/doc/…
– CbL
Mar 28 at 12:44