How to recuperate comment with the position of item recyclerView
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
add a comment |
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
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
add a comment |
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
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
android firebase firebase-realtime-database firebaseui
edited Nov 15 '18 at 3:48
Frank van Puffelen
243k29387415
243k29387415
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
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%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
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 15 '18 at 3:48
Frank van PuffelenFrank van Puffelen
243k29387415
243k29387415
add a comment |
add a comment |
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%2f53311913%2fhow-to-recuperate-comment-with-the-position-of-item-recyclerview%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
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