![]() |
VOOZH | about |
This is the Part 16 of "Build a Social Media App on Android Studio" tutorial, and we are going to cover the following functionalities in this article:
Step 1: Working with the fragment_profile.xml file
Here we are adding a RecyclerView to view the blogs posted by the current user.
Step 2: Working with the ProfileFragment.java file
Here we are going to retrieve value from the Posts node in such a way that uid of the current user is equal to uid of the user having a post
DatabaseReference databaseReference=FirebaseDatabase.getInstance().getReference("Posts");
Query query=databaseReference.orderByChild("uid").equalTo(uid);
Below is the code for the ProfileFragment.java file.
Output:
Note: Please Add drawable items before running the Application
Below is the final file structure after performing these operations:
👁 ImageGitHub link for this project: https://github.com/Anni1123/SocialMediaPlatform