1. Download our Official Android App: Forums for Android!

Apps how to properly handle recycling of views in gridview

Discussion in 'Android Development' started by pradeepkumar reddy, Aug 2, 2016.

  1. pradeepkumar reddy

    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    9
    Joined:
    Aug 2, 2016

    Aug 2, 2016
    9
    0
    25
    Male
    Bharat
    gridView recycling views is creating problem. if i select an image and scroll down, some other images are selected. how to solve this problem. how to properly handle recycling of views and restore the state of existing views when the gridView is recycling views.
     

    Advertisement

  2. Thom

    Thom  
    VIP Member
    Rank:
     #22
    Points:
    1,318
    Posts:
    11,942
    Joined:
    Feb 16, 2011

    Feb 16, 2011
    11,942
    4,920
    1,318
    Male
    Software Developer
    Keene, NH USA
    Welcome to Android Forums.

    This thread was moved to this forum that is dedicated to discussing development questions.

    ... Thom
     
  3. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,271
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,271
    10,370
    1,988
    Male
    Software developer
    South West of England
    Absolutely impossible to answer this without seeing your code.
     
    scary alien, mikedt and Thom like this.
  4. pradeepkumar reddy

    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    9
    Joined:
    Aug 2, 2016

    Aug 2, 2016
    9
    0
    25
    Male
    Bharat
    Why impossible to answer without looking at my code ? can't you explain with an example .
    In the question i had mentioned that when i select an image and scroll down other images are shown as selected, because the views are reused by recycler view. Now can you write your code and show how to solve this issue
     
  5. mikedt

    mikedt 你好
    Rank:
     #6
    Points:
    2,238
    Posts:
    24,615
    Joined:
    Sep 22, 2010

    Sep 22, 2010
    24,615
    13,624
    2,238
    Teachaaa
    Jinan, China
    Is this homework or college assignment question? I think they want you to provide your own code, and not ask others to do it for you.
     
    palmtree5, scary alien and LV426 like this.
  6. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,271
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,271
    10,370
    1,988
    Male
    Software developer
    South West of England
    That's not how technical Q&A forums work. Nobody is going to write huge blocks of code for you from scratch. If you wanted an example of how to write a GridView with recycling, then there are many useful examples on the web of how to do this. I won't bore you with the links, I'm sure you're capable of using Google.

    If you have specific problems with your code, then by all means post up your code and if anyone can spot the problem then they will be only too happy to help out. But you have to give something to work with.
     
    scary alien and mikedt like this.
  7. pradeepkumar reddy

    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    9
    Joined:
    Aug 2, 2016

    Aug 2, 2016
    9
    0
    25
    Male
    Bharat
    how does it matter to you, whether it is homework or college assignment question ? If you know the answer post it. Don't just pass time by posting silly replies.
     
  8. pradeepkumar reddy

    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    9
    Joined:
    Aug 2, 2016

    Aug 2, 2016
    9
    0
    25
    Male
    Bharat
    nothing useful in your reply............. do you know any thing about the topic ?
     
  9. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,271
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,271
    10,370
    1,988
    Male
    Software developer
    South West of England
    Yes I do.

    What I'm not going to do is write your code for you, and as I said if you want an example, there are many on the web.

    There is not just one solution to your problem, and until we see the specific way you've tried to solve it, and failed, then no further answers can be given to your question.

    That's about the most useful answer I can give to your question at this point, until you provide more information, as requested above.
     
    codesplice, scary alien and mikedt like this.
  10. mikedt

    mikedt 你好
    Rank:
     #6
    Points:
    2,238
    Posts:
    24,615
    Joined:
    Sep 22, 2010

    Sep 22, 2010
    24,615
    13,624
    2,238
    Teachaaa
    Jinan, China
    Yes it does actually. [emoji14] Being a school teacher, I want my students to solve their own homework and assignment problems, and not be asking on the interwebs for others to do it for them.


    BTW listen to @LV426, he knows what he's talking about. :)
     
  11. pradeepkumar reddy

    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    9
    Joined:
    Aug 2, 2016

    Aug 2, 2016
    9
    0
    25
    Male
    Bharat
    nothing technical in your reply............. BTW, i found the solution. Whenever i find time, i will post the answer.. It seems that you guys don't have any work. This forum is not so useful. let me unsubscribe from this . instead of wasting time discussing useless things like this.
     
  12. pradeepkumar reddy

    Thread Starter
    Rank:
    None
    Points:
    25
    Posts:
    9
    Joined:
    Aug 2, 2016

    Aug 2, 2016
    9
    0
    25
    Male
    Bharat
    I think this is one of the worst forums for android developers.
     
    #12 pradeepkumar reddy, Aug 12, 2016
    Last edited by a moderator: Aug 12, 2016
  13. mikedt

    mikedt 你好
    Rank:
     #6
    Points:
    2,238
    Posts:
    24,615
    Joined:
    Sep 22, 2010

    Sep 22, 2010
    24,615
    13,624
    2,238
    Teachaaa
    Jinan, China
    Please do post your solution, so that others may learn from your work.

    Regards, teacher Michael. :)
     
  14. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,271
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,271
    10,370
    1,988
    Male
    Software developer
    South West of England
    Well done finding a solution.
    I don't really know what your problem is because all that was requested of you was to provide more information about your problem. Not unreasonable. The information you gave was insufficient to answer. However if your conclusion from this is that the forum is useless then you are mistaken. There are many knowledgeable members who contribute, and this forum is far more tolerant than Stack Overflow. If you asked the same question there it would be down voted and closed.
     
    codesplice and scary alien like this.
  15. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,271
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,271
    10,370
    1,988
    Male
    Software developer
    South West of England
    Bye bye then.
     
  16. lunatic59

    lunatic59 Moderati ergo sum
    Moderator
    Rank:
     #2
    Points:
    4,238
    Posts:
    36,785
    Joined:
    Jun 12, 2010

    Jun 12, 2010
    36,785
    35,033
    4,238
    Male
    IT
    Pennsylvania
    Android Forums is a user support forum. This means that one member volunteers to help another out when they want, and when they can. The only incentive is to build a community for our mutual benefit. This is an example of how NOT to do that.

    Let's go over a few suggestions to figure out how to help each other.

    • First and foremost, be civil. Don't call others names or become aggressive just because you didn't get what you want.
    • If you ask a question -- especially a technical one, please include enough information so that it can be understood.
    • If you ask for something specific from another member, explaining why it's needed or necessary goes a long way.
    • If you are going to help someone, then help them without accusation or judgement. If you can't, or don't wish to help, that's okay, too but let's not be too vocal about not helping.
    • Smile. It helps. :) <-- see?
     
    mikedt, palmtree5, codesplice and 2 others like this.
  17. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #11
    Points:
    1,988
    Posts:
    7,271
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    7,271
    10,370
    1,988
    Male
    Software developer
    South West of England
    Still don't get why code was not provided :thinking::)

    And no tech Q&A forum will provide complete app code written for you.

    Maybe should set expectations in the 'readme first'. Like anyone actually reads that :rolleyes:
     

Share This Page

Loading...