I have a list view that has different items, each item has a comment button, Where he will be able to comment on all the comments and see, but when I click on the comment button, it takes time, about 5 seconds, which is very long and different from the other buttons of the same activity.
My code from the adapter view is here:
comment.setOnClickListener {@Override Click Public Zero (see V) {intent = new intent (); Intent.setClass (GetContext (), Nouveau Comteiner.class); Intestine Input Extra ("Object", M. GetAbject ()); GetContext (). Initialization (intent);}});
there
- Do not use getContext repeatedly.
- Create a reference variable in the class and start in the constructor with getContext (); Or close to the activity
-
Use this kind of intent.
intent to intent = new intent (getContext (), Nouveau commitments class); Intent.putExtra ("objectid", m.getObjectid ());
current activity (intent);
- Please do as much as you can manage your code, because sometimes we do some code incorrectly, which will affect the performance of the app, please Know the thing. It will affect you and your coding.
I hope this will help you.
No comments:
Post a Comment