Your tutorials are great, a sunshine ray of java through all that Kotlin stuff on all the Internet. At universities in general, they require java a lot. All I know I learned from your channel, thanks!
@CodeWithCal Great tutorial! My listview loads up perfectly but the onclick is not working when I select an item from the list, instead, the program crashes. I've looked at the other .java files and I can't find any issues. Would you mind taking a look at my code?
very effective tutorial.if you continue like this, your channel will grow a lot some thing to improve. 1. audio quality(it seems like you using computer built in microphone to record). 2. plz zoom the text.so that it more viewable.
Great tutorial, it really helped. Every thing loads fine the first time the activity is ran, however if I go to another activity then return the list is doubled. How can I save the progress on a page so it is the same each time I load it?
Thanks a million Cal for the outstanding tutorial. Works like a charm!! I just have one question, when scroll down the listview and click on any item (item number 30 for example) , it goes to its detailed activity perfectly. But when i get back to the listview again, the list starts all over from the beginning (from item number 1), not from the item which I clicked. Is there a way to do that? That would be really appreciated.
Glad you liked the tutorial 🙂 If you made the cell height fixed say for example 100dp. Currently if the user selects say item 30 you'll pass the item via the intent into detail activity. What you'll need to do is override the onbackpressed method on the detail activity and pass that item back to to the list view activity via an intent I'm pretty sure is possible. then calculate to set the scroll view position say 30 times 100. Then set the listview scroll view. I haven't done it myself so some of my assumptions may be incorrect. But give it a go and if you have any dramas let me know
Hi! At 10:52 you went over the OnClickListener about booting up a new activity on click, and I'll like to ask, I'll like to modify each different shape to link to a different type of activity every time, for example, clicking the triangle would open up Activity1.java, with the hexagon opening up Activity2.java with vastly different content. How would I go about modifying the OnClickListener to do this? Thank you so much in advance.
So in onItemClick() You could open different activities based on the shape name so below Shape selectShape = (Shape) (listView.getItemAtPosition(position)); if(selectedShape.name.contains("Circle")) { // circle intent } else if(selectedShape.name.contains("Square")) { // square intent } else { // default click action } Is that what you are after?
@@CodeWithCal Yes, it took a bit of tweaking, but thank you so much! I can continue with my project now. If anyone in the future needs it, here's my slightly edited code: private void setUpOnClickListener() { //go to another page listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView parent, View view, int position, long id) { Shape selectShape = (Shape) (listView.getItemAtPosition(position)); if(selectShape.name.contains("Circle")) { // circle intent Intent showDetail = new Intent(getApplicationContext(), myclassname.class); startActivity(showDetail); } else if(selectShape.name.contains("Square")){ // square intent Intent showDetail2 = new Intent(getApplicationContext(), myclassname2.class); startActivity(showDetail2); } else{ // default click action println("Howdy"); //this can be whatever you want } } }); } Also, you may need to change in Shape.java private String name; to public String name; for this to work, just a disclaimer as I've only been up to Part 2 of this tutorial so I won't know if this change may affect the later tutorials. (All of Part 2 still works otherwise)
The code that populates the list is probably being called more times than you are hoping for. Put in a break point and run in debug mode to see how many times it is called
ua-cam.com/video/4k1ZMpO9Zn0/v-deo.html Maybe a bit more than what you asking for. But check out the SQLite tutorial, we delete items from the list in this tutorial.
@@Asma-od1vf you should be getting an error message in your console. Open up the console and look for something with the term exception in it then google that :)
Bonjour, je sais pas si vous allez pouvoir me donner l'info. J'ai créé une liste view et je croyais pouvoir attacher une autre liste wiew mais je n'y arrive pas. Mon projet et de présenter des articles de péche et pour cela j'ai besoin de créer des catégories exemples A1) matériels de pêche et B1) matériels vêtements de pêche sous catégories Aa1 accessoires de pêche les bouchons Ab1 les apats Ac1 les Cannes à pêche.... et une dernière sous catégorie Aaa1 les bouchon bois Aaa2 les bouchons pvc Aaa3 les bouchons..... Et après la fiche de l'article. Comment procéder. J'ai cherché et rien trouvé si vous pouviez m'orienter ou me donner une source ou autre je suis preneur. Merci beaucoup par avance.
Bonjour. Google translate lead me to believe you're trying to build an expandable list view? www.journaldev.com/9942/android-expandablelistview-example-tutorial Hope this helps. Merci, mon ami.
put your paypal account so I can give you some money if I get the job. thanks for everything, learned a lot, coming from java and definitely android is a lot more abstract than normal java, I will take some time to get use to the built in classes that android studio has.
paypal.me/ccahillapps Please feel zero obligation, I'm happy to help for the sake of helping. Good luck, fingers crossed you land the job you are after 🍀🤞
Somehow i found your channel, useful tutorial for me, i wish you have better future on your channel. Thanks for the tutorial!
Thanks. Glad you found some use in the tutorial :)
thanks man, you helped me a lot in college with this video.
Your tutorials are great, a sunshine ray of java through all that Kotlin stuff on all the Internet. At universities in general, they require java a lot. All I know I learned from your channel, thanks!
Thank you so much, I really really appreciate that, keep up the good work bro :)
🙏
@CodeWithCal Great tutorial! My listview loads up perfectly but the onclick is not working when I select an item from the list, instead, the program crashes. I've looked at the other .java files and I can't find any issues. Would you mind taking a look at my code?
very effective tutorial.if you continue like this, your channel will grow a lot
some thing to improve.
1. audio quality(it seems like you using computer built in microphone to record).
2. plz zoom the text.so that it more viewable.
Thanks for the feedback 😊
Sir thank you soo much sir! great work! i will share it with all my friends!
Great tutorial, it really helped. Every thing loads fine the first time the activity is ran, however if I go to another activity then return the list is doubled. How can I save the progress on a page so it is the same each time I load it?
Thanks a million Cal for the outstanding tutorial. Works like a charm!!
I just have one question, when scroll down the listview and click on any item (item number 30 for example) , it goes to its detailed activity perfectly. But when i get back to the listview again, the list starts all over from the beginning (from item number 1), not from the item which I clicked. Is there a way to do that? That would be really appreciated.
Glad you liked the tutorial 🙂
If you made the cell height fixed say for example 100dp.
Currently if the user selects say item 30 you'll pass the item via the intent into detail activity. What you'll need to do is override the onbackpressed method on the detail activity and pass that item back to to the list view activity via an intent I'm pretty sure is possible.
then calculate to set the scroll view position say 30 times 100. Then set the listview scroll view.
I haven't done it myself so some of my assumptions may be incorrect. But give it a go and if you have any dramas let me know
Hi! At 10:52 you went over the OnClickListener about booting up a new activity on click, and I'll like to ask, I'll like to modify each different shape to link to a different type of activity every time, for example, clicking the triangle would open up Activity1.java, with the hexagon opening up Activity2.java with vastly different content.
How would I go about modifying the OnClickListener to do this? Thank you so much in advance.
So in onItemClick()
You could open different activities based on the shape name
so below
Shape selectShape = (Shape) (listView.getItemAtPosition(position));
if(selectedShape.name.contains("Circle"))
{
// circle intent
}
else if(selectedShape.name.contains("Square"))
{
// square intent
}
else
{
// default click action
}
Is that what you are after?
@@CodeWithCal Yes, it took a bit of tweaking, but thank you so much! I can continue with my project now.
If anyone in the future needs it, here's my slightly edited code:
private void setUpOnClickListener()
{ //go to another page
listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView parent, View view, int position, long id)
{
Shape selectShape = (Shape) (listView.getItemAtPosition(position));
if(selectShape.name.contains("Circle"))
{
// circle intent
Intent showDetail = new Intent(getApplicationContext(), myclassname.class);
startActivity(showDetail);
}
else if(selectShape.name.contains("Square")){
// square intent
Intent showDetail2 = new Intent(getApplicationContext(), myclassname2.class);
startActivity(showDetail2);
}
else{
// default click action
println("Howdy"); //this can be whatever you want
}
}
});
}
Also, you may need to change in Shape.java
private String name;
to
public String name;
for this to work, just a disclaimer as I've only been up to Part 2 of this tutorial so I won't know if this change may affect the later tutorials. (All of Part 2 still works otherwise)
@@Seafairlynn Great work ☺️
Hi Cal, do you happen to know why my listview is duplicating cells ? thanks a lot
The code that populates the list is probably being called more times than you are hoping for. Put in a break point and run in debug mode to see how many times it is called
Could you do a video where you show how to add and delete things from the list as well?
ua-cam.com/video/4k1ZMpO9Zn0/v-deo.html
Maybe a bit more than what you asking for. But check out the SQLite tutorial, we delete items from the list in this tutorial.
@@CodeWithCal Thanks will do!
i have a problem. when i click view it show "building name" and no image. please help me
How do I create an action to open a new activity when I click on an item in the list?
10:52
Thanks
Hi cal ..
I try to write your code but i need your help to resolve my problem please am student and i really really need your help
Sure, I'll give it a go. Whats the problem?
@@CodeWithCal thank u so much ...
The problem when I press in shape_cell the app is stopped suddenly..
I do not know what is problem ?
@@Asma-od1vf you should be getting an error message in your console.
Open up the console and look for something with the term exception in it then google that :)
Bonjour, je sais pas si vous allez pouvoir me donner l'info. J'ai créé une liste view et je croyais pouvoir attacher une autre liste wiew mais je n'y arrive pas. Mon projet et de présenter des articles de péche et pour cela j'ai besoin de créer des catégories exemples A1) matériels de pêche et B1) matériels vêtements de pêche sous catégories Aa1 accessoires de pêche les bouchons Ab1 les apats Ac1 les Cannes à pêche.... et une dernière sous catégorie Aaa1 les bouchon bois Aaa2 les bouchons pvc Aaa3 les bouchons..... Et après la fiche de l'article. Comment procéder. J'ai cherché et rien trouvé si vous pouviez m'orienter ou me donner une source ou autre je suis preneur. Merci beaucoup par avance.
Bonjour.
Google translate lead me to believe you're trying to build an expandable list view?
www.journaldev.com/9942/android-expandablelistview-example-tutorial
Hope this helps. Merci, mon ami.
@@CodeWithCal This made me laugh when i needed it the most after tirelessly finishing Uni work thanks Cal 😂
put your paypal account so I can give you some money if I get the job. thanks for everything, learned a lot, coming from java and definitely android is a lot more abstract than normal java, I will take some time to get use to the built in classes that android studio has.
paypal.me/ccahillapps
Please feel zero obligation, I'm happy to help for the sake of helping. Good luck, fingers crossed you land the job you are after 🍀🤞
I'm just wondering how are you able to write in this small-sized text??
Seriously regardless of the viewers!
Thanks for the feedback, I have made the text size bigger in Android Studio for future videos.