How to recuperate comment with the position of item recyclerView










0















I'm a beginner in developing android



I create a news feed where you can comment on posts, to do this I use firebase as a database and I use FirebaseRecyclerAdapter and FirebaseRecyclerOptions



I want the user to click on the "Comment" button of the first RecyclerView



The second RecyclerView displays the comments according to the post clicked.



I have no idea how to do this, knowing that I tried by capturing the position of the post.



Thank you. Thank you.










share|improve this question



















  • 1





    Welcome to SO, Please post the code that you tried, it would make your question more genuine and more likely to be answered.

    – PradyumanDixit
    Nov 15 '18 at 3:39















0















I'm a beginner in developing android



I create a news feed where you can comment on posts, to do this I use firebase as a database and I use FirebaseRecyclerAdapter and FirebaseRecyclerOptions



I want the user to click on the "Comment" button of the first RecyclerView



The second RecyclerView displays the comments according to the post clicked.



I have no idea how to do this, knowing that I tried by capturing the position of the post.



Thank you. Thank you.










share|improve this question



















  • 1





    Welcome to SO, Please post the code that you tried, it would make your question more genuine and more likely to be answered.

    – PradyumanDixit
    Nov 15 '18 at 3:39













0












0








0








I'm a beginner in developing android



I create a news feed where you can comment on posts, to do this I use firebase as a database and I use FirebaseRecyclerAdapter and FirebaseRecyclerOptions



I want the user to click on the "Comment" button of the first RecyclerView



The second RecyclerView displays the comments according to the post clicked.



I have no idea how to do this, knowing that I tried by capturing the position of the post.



Thank you. Thank you.










share|improve this question
















I'm a beginner in developing android



I create a news feed where you can comment on posts, to do this I use firebase as a database and I use FirebaseRecyclerAdapter and FirebaseRecyclerOptions



I want the user to click on the "Comment" button of the first RecyclerView



The second RecyclerView displays the comments according to the post clicked.



I have no idea how to do this, knowing that I tried by capturing the position of the post.



Thank you. Thank you.







android firebase firebase-realtime-database firebaseui






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 3:48









Frank van Puffelen

239k29382409




239k29382409










asked Nov 15 '18 at 3:19









Malik KhelfaMalik Khelfa

11




11







  • 1





    Welcome to SO, Please post the code that you tried, it would make your question more genuine and more likely to be answered.

    – PradyumanDixit
    Nov 15 '18 at 3:39












  • 1





    Welcome to SO, Please post the code that you tried, it would make your question more genuine and more likely to be answered.

    – PradyumanDixit
    Nov 15 '18 at 3:39







1




1





Welcome to SO, Please post the code that you tried, it would make your question more genuine and more likely to be answered.

– PradyumanDixit
Nov 15 '18 at 3:39





Welcome to SO, Please post the code that you tried, it would make your question more genuine and more likely to be answered.

– PradyumanDixit
Nov 15 '18 at 3:39












1 Answer
1






active

oldest

votes


















0














The first thing you'll need to do is record what pot the user clicked on. If you're using the Realtime Database, I recommend doing that by recording the key of the item that they clicked on. For some hints on how to do that, see:



  • Retrieving the Firebase key from onItemClick in FirebaseListAdapter

  • How to get obj key from FirebaseListAdapter on Item Click. FirebaseUI

Next up, you need to pass that key to the second recycler view somehow.



If the two recycler views are in the same activity, you can use a member field to store the comment that was clicked.



If the two recycler views are in separate activities, you can store the key in Android's shared preferences. For more on this data transfer mechanism, see:




  • SharedPreferences in the Android reference documentation

  • How to use SharedPreferences in Android to store, fetch and edit values

Finally, you'll need to use the key to load the comments for that specific post. This depends on your exact data structure, but I recommend starting with the documentation on working with lists of data or FirebaseUI, similar to what you likely already have.






share|improve this answer






















    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%2f53311913%2fhow-to-recuperate-comment-with-the-position-of-item-recyclerview%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    The first thing you'll need to do is record what pot the user clicked on. If you're using the Realtime Database, I recommend doing that by recording the key of the item that they clicked on. For some hints on how to do that, see:



    • Retrieving the Firebase key from onItemClick in FirebaseListAdapter

    • How to get obj key from FirebaseListAdapter on Item Click. FirebaseUI

    Next up, you need to pass that key to the second recycler view somehow.



    If the two recycler views are in the same activity, you can use a member field to store the comment that was clicked.



    If the two recycler views are in separate activities, you can store the key in Android's shared preferences. For more on this data transfer mechanism, see:




    • SharedPreferences in the Android reference documentation

    • How to use SharedPreferences in Android to store, fetch and edit values

    Finally, you'll need to use the key to load the comments for that specific post. This depends on your exact data structure, but I recommend starting with the documentation on working with lists of data or FirebaseUI, similar to what you likely already have.






    share|improve this answer



























      0














      The first thing you'll need to do is record what pot the user clicked on. If you're using the Realtime Database, I recommend doing that by recording the key of the item that they clicked on. For some hints on how to do that, see:



      • Retrieving the Firebase key from onItemClick in FirebaseListAdapter

      • How to get obj key from FirebaseListAdapter on Item Click. FirebaseUI

      Next up, you need to pass that key to the second recycler view somehow.



      If the two recycler views are in the same activity, you can use a member field to store the comment that was clicked.



      If the two recycler views are in separate activities, you can store the key in Android's shared preferences. For more on this data transfer mechanism, see:




      • SharedPreferences in the Android reference documentation

      • How to use SharedPreferences in Android to store, fetch and edit values

      Finally, you'll need to use the key to load the comments for that specific post. This depends on your exact data structure, but I recommend starting with the documentation on working with lists of data or FirebaseUI, similar to what you likely already have.






      share|improve this answer

























        0












        0








        0







        The first thing you'll need to do is record what pot the user clicked on. If you're using the Realtime Database, I recommend doing that by recording the key of the item that they clicked on. For some hints on how to do that, see:



        • Retrieving the Firebase key from onItemClick in FirebaseListAdapter

        • How to get obj key from FirebaseListAdapter on Item Click. FirebaseUI

        Next up, you need to pass that key to the second recycler view somehow.



        If the two recycler views are in the same activity, you can use a member field to store the comment that was clicked.



        If the two recycler views are in separate activities, you can store the key in Android's shared preferences. For more on this data transfer mechanism, see:




        • SharedPreferences in the Android reference documentation

        • How to use SharedPreferences in Android to store, fetch and edit values

        Finally, you'll need to use the key to load the comments for that specific post. This depends on your exact data structure, but I recommend starting with the documentation on working with lists of data or FirebaseUI, similar to what you likely already have.






        share|improve this answer













        The first thing you'll need to do is record what pot the user clicked on. If you're using the Realtime Database, I recommend doing that by recording the key of the item that they clicked on. For some hints on how to do that, see:



        • Retrieving the Firebase key from onItemClick in FirebaseListAdapter

        • How to get obj key from FirebaseListAdapter on Item Click. FirebaseUI

        Next up, you need to pass that key to the second recycler view somehow.



        If the two recycler views are in the same activity, you can use a member field to store the comment that was clicked.



        If the two recycler views are in separate activities, you can store the key in Android's shared preferences. For more on this data transfer mechanism, see:




        • SharedPreferences in the Android reference documentation

        • How to use SharedPreferences in Android to store, fetch and edit values

        Finally, you'll need to use the key to load the comments for that specific post. This depends on your exact data structure, but I recommend starting with the documentation on working with lists of data or FirebaseUI, similar to what you likely already have.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 15 '18 at 3:48









        Frank van PuffelenFrank van Puffelen

        239k29382409




        239k29382409





























            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%2f53311913%2fhow-to-recuperate-comment-with-the-position-of-item-recyclerview%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







            這個網誌中的熱門文章

            How to read a connectionString WITH PROVIDER in .NET Core?

            In R, how to develop a multiplot heatmap.2 figure showing key labels successfully

            Museum of Modern and Contemporary Art of Trento and Rovereto