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;








0















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.



Android Profiler 1



Android Profiler 2



Android Profiler 3



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);












share|improve this question
























  • 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

















0















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.



Android Profiler 1



Android Profiler 2



Android Profiler 3



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);












share|improve this question
























  • 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













0












0








0








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.



Android Profiler 1



Android Profiler 2



Android Profiler 3



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);












share|improve this question
















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.



Android Profiler 1



Android Profiler 2



Android Profiler 3



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);









android performance android-profiler






share|improve this question















share|improve this question













share|improve this question




share|improve this question








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

















  • 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












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
);



);













draft saved

draft discarded


















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















draft saved

draft discarded
















































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.




draft saved


draft discarded














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





















































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







Popular posts from this blog

SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해