Best video for RecyclerView Item Click Forwarding by far! Question: why does the onClickListener in an adapter need to be placed in an init { } block to work, but in fragments and activities you don't need to do this?
I like your video. They are very good and easy to understand. Please can you do a video on a PDF app. That an app that has PDF and when you click on it you can see the contain of the pdf
🔥Great video but I use a Fragment instead of Activity and when i pass the parameter "recyclerView Interface" as "this" show as error What do you think? or what is the alternative of this in Fragment Situation
Actually, I'm not using an API. I got the descriptions from the internet and the names/abbreviations from my biochem book. The vector images of the molecules were made in Adobe Illustrator. I'm gonna be using them in an app I'm working on so probably won't be releasing them😬 Thought it would be cool to use them rather than the default vectors that come with Android Studio. Little different than what everyone else is doing on UA-cam and it's more of a real-world example I think.
I getting error in main acitivity adapter where tour error is gone by writing this my is not going and it is sating to create recyclerview interface then making it null
I am so confused on the very last part where you're putting all the different pages' info on one activity... any way you could go more in depth with me? Struggling for school :(
@@Sydewinder890 it also worked on me, but can't quite follow how to put an extra description, i had my data stored in the string. did u add the additional textview in the adapter? kinda confusing
I'm not sure where I saw this on the Android Developers page but from what I understand, you're supposed to handle what happens in the onClickListener from your activity and use a callback implementation using an interface. So in the video, we passed the interface to our adaptor and from the adaptor, we were able to call the callback function when an item was clicked because we set an onClickListener to each of our itemViews. Did that answer your question? I'm not entirely sure what you mean by "itemCallback". Maybe we're talking about the same thing?
You showed all the steps but didn't clarify the last ones. If you don't want others to be able to use what you teach, just don't post videos for views. And what is up with you showing such a zoomed-in portion of your code? It's very difficult to follow.
Can someone help me i do everything as in video but i still get this error "error: not an enclosing class: RecyclerViewInterface myAdapter = new MyAdapter(ItemView.this, userArrayList, RecyclerViewInterface.this);" I am not sure why i get this error, also my program has little bit more code for some other things and i dont know if something in there can cause this problem.
At 5:53, you added this, but not working for me My code:- ElementsRecyclerAdapter elementsRecyclerAdapter = new ElementsRecyclerAdapter(elementsList, ElementsRecyclerActivity.this, this); Error:- 'ElementsRecyclerAdapter(java.util.ArrayList, android.content.Context, com.pbgamesandapps.pbchemx.ElementsRecyclerInterface)' in 'com.pbgamesandapps.pbchemx.ElementsRecyclerAdapter' cannot be applied to '(java.util.ArrayList, com.pbgamesandapps.pbchemx.ElementsRecyclerActivity, anonymous com.android.volley.Response.Listener)' My constructor for recycler view adapter :- public ElementsRecyclerAdapter(ArrayList elementsList, Context context, ElementsRecyclerInterface elementsRecyclerInterface) { this.elementsModels = elementsList; this.context = context; this.elementsRecyclerInterface = elementsRecyclerInterface; } Interface:- package com.pbgamesandapps.pbchemx; public interface ElementsRecyclerInterface { void onClick(int position); }
What if I'm fill the array by MVVM way ? I have tried your way, but the value always returns null in the next activity. I have fill the results array by call observe mntRequestViewModel.getMntAllReqMutableLiveData().observe(getViewLifecycleOwner(), new Observer() { @Override public void onChanged(List mntRequests) { if (mntRequests == null) { Toast.makeText(getActivity(), "failed to get all requests", Toast.LENGTH_LONG).show(); } else { //mntRequests is the array that I should use to get position in onItemClick ... allReqResultsAdapter.setResults(mntRequests);
Finally someone who explains it properly and doesn't create 15 classes and interfaces for a click listener... Thanks😁
Still a better explanation than my pre-recorded lecture that we have been using since 4 years ago
Thank you! When stackoverflow doesnt help or only offers deprecated information... UA-cam helps! You are the best!
thanks man saves a ton of hassle and works like a charm truly helpful
thx bro, finally someone who can it simply explain
Great video! Easy to understand. Thank you!
Best video for RecyclerView Item Click Forwarding by far!
Question: why does the onClickListener in an adapter need to be placed in an init { } block to work, but in fragments and activities you don't need to do this?
Excelent Explanation!!! Thank you so much. You're brilliant
Thank you very much man! Efficient and easy to understand!
Man, great video! Helped me so much. Thanks
Thank u so much This video very help me with my university project
That's great to hear!
You have helped me immensely thank you very much!
Thanks man first video that really helped
Thank You. Good Explanation
pure gold! Thank you
Great explanation. Worked for me
Great video as always!! Thank you man❤
good content i understand the concept even don't work for me, but realy understand a lot
Man, you make such good content!
Stellar work man.
You've made it quite easy......
gracias crack me sirvio mucho. Saludos desde Colombia
please keep posting you are doing greate job and deserve more likes as you explain really well
Thank you for helping me.
Thanks bro, its help me a lot
Really Good! Keep making more such videos..
this is special, thanks a ton
Nice explanation 👍
nice sir, I salute you
you are a legend bro !
thanks a lot sir 😁
6:36 what should I use, I couldnt understand it
is there a video for the the last thing u did? how to swap to a new activity?
Where did you put the description of each elements? In another xml file? Sorry I'm still learning mobile dev.
Hey if it's on firebase it will be the best
Do you have a way to do this between fragments in an activity?
I like your video. They are very good and easy to understand. Please can you do a video on a PDF app. That an app that has PDF and when you click on it you can see the contain of the pdf
Perfect Job
I put recyclerView on a dynamic layout container , layout.addView(), then "click" is "invoke interface on a null object reference", please help!
Muy bueno, me sirivio!. Crack
Where did you get the add method for your model class? You didn't even code it in the class itself
Eres la mera vrga mijo, muchas gracias
🔥Great video but I use a Fragment instead of Activity and when i pass the parameter "recyclerView Interface" as "this" show as error What do you think? or what is the alternative of this in Fragment Situation
If your using kotlin then you could add activity instead of this or getActivity().
Quality videos, thank you so much.
Are you using an API to retrieve the molecules data? Can you show us how to do that? Thank you again!!
Actually, I'm not using an API. I got the descriptions from the internet and the names/abbreviations from my biochem book. The vector images of the molecules were made in Adobe Illustrator. I'm gonna be using them in an app I'm working on so probably won't be releasing them😬 Thought it would be cool to use them rather than the default vectors that come with Android Studio. Little different than what everyone else is doing on UA-cam and it's more of a real-world example I think.
helped me so much
I getting error in main acitivity adapter where tour error is gone by writing this my is not going and it is sating to create recyclerview interface then making it null
Could you please add searching option in this app
thx it's too helpful
how to solve that get method u put in putextras? it says cant solve method?
Can you create a video on how you create a button in an item? Please and thank you
I am so confused on the very last part where you're putting all the different pages' info on one activity... any way you could go more in depth with me? Struggling for school :(
Is it possible to retrieve data from Firebase?
I cant put this in parameter it is giving me red line in this in adapter parameter in out main activity what should I do
Bro please help
In Android studio there is an error how to solve it ?
APPT: error: resources drawable/xyz not found.
Please I need to know how to make the second activity
thanks bro u save me)))))))))))))))
How we add onclick listner
Thank you
How do i add a searchView in this recycler view?
How to open a pdf when clicked on a recycler view item?
From where can i get these pictures?
hi, i get error in int pos = getAdapterPosition();, its on red and nothings work
i got a simillar problem did you solve yours? when i want to write "intent.putExtra("NAME",ProductsModel.get(position).getname);"the .get is in red
Hi sir, how to write code for fragment instead of activity?
I doesn't find solution for that, so i only call setOnClick for the layout of item
ABİM ÇOK TAŞAKLISIN
how to add the additional information for the next activity, Sir? please we need a tutorial 🥺
I just typed the code from the explanation and it works
@@Sydewinder890 it also worked on me, but can't quite follow how to put an extra description, i had my data stored in the string. did u add the additional textview in the adapter? kinda confusing
what if there is SEARCHVIEW??
what about json object?
thanks!
Good work but does this way better than itemCallback ?
I'm not sure where I saw this on the Android Developers page but from what I understand, you're supposed to handle what happens in the onClickListener from your activity and use a callback implementation using an interface.
So in the video, we passed the interface to our adaptor and from the adaptor, we were able to call the callback function when an item was clicked because we set an onClickListener to each of our itemViews.
Did that answer your question? I'm not entirely sure what you mean by "itemCallback". Maybe we're talking about the same thing?
Hey dude, is there any way to help?
I would like to ask how to do the same while using jet pack lib binding ?????????????????????????????????????????????????????????????????
Anyone here who has an issue in clicking an item in the recyclerview twice to work the setOnlClickListener on the adaptter class?
What do you mean by clicking an item twice? I don't think I fully understand the question
But don't forget to add in Manifest new Activity.
bro, may we get this project's source code ❣❣
did you find it
man please send me the source code i need it so urgently
hi sir where are you frome
Recyclerview inside fragment, to display item in another fragment is not documented in google and it is not explain in youtube !!!!!!!!!
good
thank you
pls upload this code ):
I'll get on it!
@@PracticalCoding did you upload it? i need it urgetly
why you skip coding?
i hate java interfaces, I prefer to use intent & broadcast methodology...
time waste
You showed all the steps but didn't clarify the last ones. If you don't want others to be able to use what you teach, just don't post videos for views. And what is up with you showing such a zoomed-in portion of your code? It's very difficult to follow.
Can someone help me i do everything as in video but i still get this error "error: not an enclosing class: RecyclerViewInterface
myAdapter = new MyAdapter(ItemView.this, userArrayList, RecyclerViewInterface.this);"
I am not sure why i get this error, also my program has little bit more code for some other things and i dont know if something in there can cause this problem.
At 5:53, you added this, but not working for me
My code:-
ElementsRecyclerAdapter elementsRecyclerAdapter = new ElementsRecyclerAdapter(elementsList,
ElementsRecyclerActivity.this, this);
Error:-
'ElementsRecyclerAdapter(java.util.ArrayList, android.content.Context, com.pbgamesandapps.pbchemx.ElementsRecyclerInterface)' in 'com.pbgamesandapps.pbchemx.ElementsRecyclerAdapter' cannot be applied to '(java.util.ArrayList, com.pbgamesandapps.pbchemx.ElementsRecyclerActivity, anonymous com.android.volley.Response.Listener)'
My constructor for recycler view adapter :-
public ElementsRecyclerAdapter(ArrayList elementsList, Context context,
ElementsRecyclerInterface elementsRecyclerInterface) {
this.elementsModels = elementsList;
this.context = context;
this.elementsRecyclerInterface = elementsRecyclerInterface;
}
Interface:-
package com.pbgamesandapps.pbchemx;
public interface ElementsRecyclerInterface {
void onClick(int position);
}
Nice Video..Uh How do you do the same thing but with opening the information in a fragment instead of switching activty ?
What if I'm fill the array by MVVM way ?
I have tried your way, but the value always returns null in the next activity.
I have fill the results array by call observe
mntRequestViewModel.getMntAllReqMutableLiveData().observe(getViewLifecycleOwner(), new Observer() {
@Override
public void onChanged(List mntRequests) {
if (mntRequests == null) {
Toast.makeText(getActivity(), "failed to get all requests", Toast.LENGTH_LONG).show();
} else {
//mntRequests is the array that I should use to get position in onItemClick ...
allReqResultsAdapter.setResults(mntRequests);
}
}
});
Bro please help
In Android studio there is an error how to solve it ?
APPT: error: resources drawable/xyz not found.
hello what if i just want the selected item to show a toast message and not a new activity how do i do that
Just make a toast message in the click listener, instead of a new intent.
Thank you
Bro please help
In Android studio there is an error how to solve it ?
APPT: error: resources drawable/xyz not found.
Bro please help
In Android studio there is an error how to solve it ?
APPT: error: resources drawable/xyz not found.
Bro please help
In Android studio there is an error how to solve it ?
APPT: error: resources drawable/xyz not found.