Android Listview Onitemclick Example

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 พ.ย. 2024

ความคิดเห็น • 254

  • @MKRLyrics
    @MKRLyrics 5 ปีที่แล้ว

    Hello sir, how can we view a pdf when we click on listview item? I'm bad at English sorry.

  • @kamalmuradov8629
    @kamalmuradov8629 7 ปีที่แล้ว +1

    Thank You...You helped me a lot...I wish you to be the best youtuber...And anyways you are the best...Thanks a lot

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Your welcome, i'm happy to help :)

  • @Ivolth
    @Ivolth 3 ปีที่แล้ว

    if i click multiple items before load the first one clicked, more than 1 activity is open, how can i fix that?

  • @Nasser-xw7se
    @Nasser-xw7se 5 หลายเดือนก่อน

    You can run the same program in Kotlin on Android Studio
    With the same detailed explanation
    Thank you very much

  • @queroin
    @queroin 7 ปีที่แล้ว +1

    Good day sir! Great tutorial. But I'm wondering how I will connect it to a SQL Database and the item you show in the listview will be replace by the data in SQL? Bad english grammar. sorry. Thanks for your response sir!

  • @jonathanalonzo5798
    @jonathanalonzo5798 4 ปีที่แล้ว

    Besides from toolbar what are the other method or component to be replaced to toolbar because i have a problem when i install the app. Thank you

  • @jottilohano2232
    @jottilohano2232 7 ปีที่แล้ว +1

    I'm my project there is no error but when I test my app the app has unfortunately close error occur plz help how I solve my error

  • @HuyHoang-og3sx
    @HuyHoang-og3sx 7 ปีที่แล้ว +1

    Thank you very much for it !!! i will Sur and view 50 times it ^^!

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Your welcome, happy coding :)

  • @nareshgaur4961
    @nareshgaur4961 7 ปีที่แล้ว

    sir can you help me ..there is an error when i click on subitem of gridview which hol the image and text..
    when i click on that it doesnot show me an detail..
    GridView->subItem->SubItem->Detail(which show me blank)

  • @raythompson139
    @raythompson139 8 ปีที่แล้ว

    Thanks, easy to follow for a learner like me.

    • @CodingDemos
      @CodingDemos  8 ปีที่แล้ว

      Thanks for watching :)

  • @ksktamiltech4130
    @ksktamiltech4130 3 ปีที่แล้ว +1

    Hi I have a little bit of problem in we browser history is showing but I click that links not string to webview do you have any idea

    • @CodingDemos
      @CodingDemos  3 ปีที่แล้ว

      Hi, I'm sorry, you want the string link to be clickable to open a page in a browser?

    • @ksktamiltech4130
      @ksktamiltech4130 3 ปีที่แล้ว

      @@CodingDemos yes

    • @CodingDemos
      @CodingDemos  3 ปีที่แล้ว

      @@ksktamiltech4130 Please refer to this link for the solution: stackoverflow.com/questions/3004515/sending-an-intent-to-browser-to-open-specific-url

    • @ksktamiltech4130
      @ksktamiltech4130 3 ปีที่แล้ว

      @@CodingDemos Bro I mean I created a browser with history activity (Open sql lite ) it's showing history but the content of web sites not clickable why .......????

  • @한은열-o7c
    @한은열-o7c 5 ปีที่แล้ว

    I have one question.
    How can I make the second activity only text, not an image?

  • @harshancl5360
    @harshancl5360 3 ปีที่แล้ว

    Exactly what I wanted sire

  • @WAQARALAMLIVE
    @WAQARALAMLIVE 7 ปีที่แล้ว +1

    how can I impliment search view in this list view ?

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Currently i don't have any video that covers search view. Here is a tutorial that might help you: blog.nkdroidsolutions.com/android-searchview-in-listview-example-tutorial/
      Happy coding :)

  • @parasarora2606
    @parasarora2606 7 ปีที่แล้ว

    very nicely explained. a big thanks

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Your welcome, happy coding :)

  • @cindyadriana93
    @cindyadriana93 7 ปีที่แล้ว

    How can I change the color and font to the View list, ie to: Australia, Brazil, China ...

  • @Sundaramsatyam12
    @Sundaramsatyam12 6 ปีที่แล้ว

    Really Helpful Nice Job Keep it up.....

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Thanks, happy coding :D

  • @zadick2026
    @zadick2026 5 ปีที่แล้ว

    Good job bro your tutorial save my time

  • @muhammadainulyaqin3719
    @muhammadainulyaqin3719 5 ปีที่แล้ว +1

    why the array in R.array get error on getResources().getStringArray(R.array.teman)?

    • @CodingDemos
      @CodingDemos  5 ปีที่แล้ว

      Hi, may I know what is the error message that you get?

  • @dnamobileapplications8850
    @dnamobileapplications8850 7 ปีที่แล้ว +1

    HI how do I interpret this to open both the flag in an imageview like you had done and also the description of the country for example in maybe perhaps a textview... Basically I want to select Canada for example and the next activity pops up with the Canadian flag and also has a description below explaining Canada's History.. I've tried doing what you did by interpreting the textview in the onclick event but it gives me an error. Not sure if I'm missing something, thanks if you respond...

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว +2

      Hi Jordan, sorry for the late reply...Can you please tell me what is the error message that you get, or maybe you can email (codingdemos@gmail.com) me your code and i'll do my best to help you out :)

    • @dnamobileapplications8850
      @dnamobileapplications8850 7 ปีที่แล้ว +1

      Hello, thank you for the response. I ended up creating a sloppy mess with a bunch of activities. I will email you my codes of what I have done now instead as it's a lot cleaner, but I want to set my text in a different way rather then having a bunch of if statements and strings. I'll email you and you can see what I mean.
      Thanks
      Jordan

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi Jordan, i received your email..i'll have a look at the code and will update you
      Thanks :)

  • @algernopkrieger1696
    @algernopkrieger1696 6 ปีที่แล้ว

    I have noticed that in your android studio you have custom widgets how do i create it? in newer versions (currently i am on v 3.1.3 ) this feature is missing. Anyone knows if it is possible to enable>?

  • @djuryprahara2848
    @djuryprahara2848 6 ปีที่แล้ว

    Nice tutorial.
    Sir..
    Please make listView and webview .👍👍🙏🙏

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      I'm glad that you like it, sure will do it :)

    • @djuryprahara2848
      @djuryprahara2848 6 ปีที่แล้ว

      I want to create a project [listview onclick to secondWebviewActivity.] thanks sir for helping me 👍👍👍👍🙏🙏🙏

  • @mohamedsaiidouertani3568
    @mohamedsaiidouertani3568 4 ปีที่แล้ว

    Thanks i lot ,but can you tell me how i can get extras when a type is Image View

  • @maribelmaligno5398
    @maribelmaligno5398 7 ปีที่แล้ว +1

    im a beginner at building an app , i apply your tutorial in my app . my problem is i use image slider with viewpager . i don't know how to intent the images in different item in my listview . please help me .

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, please email me your code (codingdemos@gmail.com) and i'll see what i can do

  • @mahmoodimtiaz2550
    @mahmoodimtiaz2550 6 ปีที่แล้ว

    Is it possible to do not open an activity for a position!? Suppose When I click on Australia it opens the second activity but when I click on China It will not open the second activity. Rest will open second activity.

  • @bangRegar777
    @bangRegar777 7 ปีที่แล้ว

    How do i add some image beside the listview ? Ex: (image)Australia .

  • @astral8439
    @astral8439 7 ปีที่แล้ว +1

    If i already have an ArrayList with itms, is there any way to set the second activity toolbar the name of an object from the first activity?....ex: if you have an arrylist with the countrys, is there any way to send the arraylist in a bundle? to get the name in the second? idk if im explaining :(

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, if you have the arraylist and you are using it to populate the listview, you can pass the item that the user have clicked on through bundle, then you read the data from the bundle in the second activity and set it as the title for the toolbar

  • @tofanbehera273
    @tofanbehera273 7 ปีที่แล้ว

    sir plz make a video how to add search button in action bar in this project

  • @chakrapanibrahmam5767
    @chakrapanibrahmam5767 6 ปีที่แล้ว

    I m try to make intent with textview but i m unable do. Can you please share me sample code for textview

  • @markjohnsegara832
    @markjohnsegara832 7 ปีที่แล้ว +1

    is there any possible to use menuview in action bar instead of toolbar? how

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Yeah i guess you can, i did a tutorial that will show you how to work with menu inside a toolbar...here is the video url: th-cam.com/video/EZ-sNN7UWFU/w-d-xo.html
      You can follow that tutorial and just skip the part where i talk about the toolbar and the changes that i made in styles.xml file
      Please do let me know if you need any help
      Happy coding :)

  • @aminakhaldi3680
    @aminakhaldi3680 5 ปีที่แล้ว +2

    excellent tuto thanks :)

  • @petermuchiri79
    @petermuchiri79 7 ปีที่แล้ว +1

    thanks so much for that tuitorial...Am requesting for onother one that have a list and when you click an item on the list,it mioves on to onother activity with register or login form

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Thanks for watching Peter, can you please give me an example about the type of items that will be in the list?

    • @petermuchiri79
      @petermuchiri79 7 ปีที่แล้ว

      First thanks for response..for example in the above tuitorial..I need when i click an item like Branzil,it displays that flag at the top and below it to have a registration form which stores data in mysql...in that case a local server such as xampp.If possible main activity to have login page,but if user has no account,he or she can create an account then login.
      For mine I want a list of counties..but can work with countries then i will change...

  • @joaocleito
    @joaocleito 4 ปีที่แล้ว

    Parabéns muito boa a sua explicação! ótimo, muito bom mesmo.

  • @rottnhombre
    @rottnhombre 6 ปีที่แล้ว

    Super helpful! Thank you!

  • @mukhlisraza
    @mukhlisraza 4 ปีที่แล้ว

    Thank you! it helped me a lot

  • @rusdimaulana1706
    @rusdimaulana1706 7 ปีที่แล้ว +1

    Hello sir. Your videos are very useful for a beginner like me. But I wanna ask, how can I add some details (pretty long text) below the imageview? Can I use or
    in string-array?

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว +1

      Hi, String-array will hold each item individually so i guess there is no need to use (
      ) whenever you wanna start a new line.
      it's best to use (
      ) in normal string, for example if you want to add a long description about a country you can do it like this:
      - Open strings.xml file and write the following code:
      Lorem ipsum dolor sit amet, consectetur
      adipiscing elit. Aenean non ipsum nulla.
      In imperdiet massa at tempor interdum. Integer mollis tristique elit sed gravida.
      Later you set a textview to that long description like this in MainActivity.java class:
      textview.setText(getResources().getString(R.string.country_description));
      I hope that helps :)

    • @rusdimaulana1706
      @rusdimaulana1706 7 ปีที่แล้ว +2

      It works! Thanks a lot. :)

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Your welcome :)

  • @MrIMacro
    @MrIMacro 2 ปีที่แล้ว

    When i click on an item, i want the app to take the user to a certain location on Google maps. Do you think it's possible?

    • @CodingDemos
      @CodingDemos  2 ปีที่แล้ว

      Hi, you can pass the latitude and longitude of that specific location and it will open that location on Google map

    • @MrIMacro
      @MrIMacro 2 ปีที่แล้ว

      @@CodingDemos Thanks for your reply. I am a beginner and don't know about passing. Could you please explain more or direct me to a tutorial. Thanks a lot

  • @maribelmaligno5398
    @maribelmaligno5398 7 ปีที่แล้ว +1

    thank you thank you so much :) you're a super big help :)

  • @addorespambasange6300
    @addorespambasange6300 6 ปีที่แล้ว

    I would like to open a Dialog Box when I click on an item. The dialog box should show a title, picture and a description for each Item clicked. How do I do so? Please help. Thank you in advance.

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Hi, you need to create an alertdialog with a custom layout, inside that layout is where you will add 2 TextViews for Title, description and an ImageView for the picture. Here is a video that I did that shows you how to create an alertdialog with a custom layout: th-cam.com/video/plnLs6aST1M/w-d-xo.html&lc=

  • @kevinkamaluddin2337
    @kevinkamaluddin2337 7 ปีที่แล้ว

    Is it possible to add search field/bar ?

  • @AliAhmad-yc4jd
    @AliAhmad-yc4jd 7 ปีที่แล้ว +1

    i have already coding searchbar listview..can you show me coding how to click the list to new activity.please help me :(

    • @AliAhmad-yc4jd
      @AliAhmad-yc4jd 7 ปีที่แล้ว

      i can give my coding to your reference,pleaseeee help me.thank you

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, can you email me your code (codingdemos@gmail.com)

  • @markjohnsegara832
    @markjohnsegara832 7 ปีที่แล้ว +1

    helo sir can i ask if you could make a toturial on how to apply your lesson on searchview actionbar thank you. happy if you will

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว +1

      Hi, yeah i'm working on a tutorial about searchview+listview...i'll let you know once it's live :)

    • @NanaOssgh
      @NanaOssgh 7 ปีที่แล้ว

      we are waiting for that please or if you are done kindly let us know

  • @sheikhjoy9
    @sheikhjoy9 5 ปีที่แล้ว

    I need help about this … I wanted to make an news portal type project or list to webview...suppose you have Australia so if I click Australia it will show me a new actitvity with webview will open url of say any aussie website … how can I do that

    • @CodingDemos
      @CodingDemos  5 ปีที่แล้ว

      Hi, you need to add WebView inside second activity. The main activity will have the ListView, when you tap on Australia, you pass a URL through Intent to the second activity. You will then use that URL that was passed through intent inside WebView to load the content of that URL.

    • @sheikhjoy9
      @sheikhjoy9 5 ปีที่แล้ว

      @@CodingDemos yeah i know...but i didnt knew how to call that url(multiple links)... i figured it out that day after watching several videos xD... thank you for your video..it really helped me alot

  • @vvshare
    @vvshare 7 ปีที่แล้ว

    Works Great!If we need to add .pdf instead of image.... how we write in android. Please Reply

  • @mimrankhan9974
    @mimrankhan9974 7 ปีที่แล้ว

    thanx man and plz make a tutorial on gridview same login apply on gridview im beginer plz

  • @eduardorezende4493
    @eduardorezende4493 6 ปีที่แล้ว

    I love you guy!!
    Thanks so much!!!!

  • @jigonoto3603
    @jigonoto3603 4 ปีที่แล้ว

    How can i display text after that procedure

  • @uvekprviuvekispredsvih2702
    @uvekprviuvekispredsvih2702 7 ปีที่แล้ว +1

    Hello, when I opet the App it shows me "Unfourtunately App Running Stopped"

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, can you please tell me what error do you see in the logcat when the app crash?

    • @uvekprviuvekispredsvih2702
      @uvekprviuvekispredsvih2702 7 ปีที่แล้ว +1

      I solved my problem, I made a mistake with create java class. Thanks

  • @charlesnjugunakangei9484
    @charlesnjugunakangei9484 5 ปีที่แล้ว

    Hey, Good job bro, what will i do to get a listview with cardview in it

  • @red_app1418
    @red_app1418 7 ปีที่แล้ว +1

    Hi,I have 1 button in SecondActivity but when i runing app this button appears in all list of Contries =))) how i can fix it?

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, so you want to show that button to specific countries only?

    • @red_app1418
      @red_app1418 7 ปีที่แล้ว

      yes

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      What you can do is pass a value through the intent that you are starting the activity with, and then in the next activity where you receiving the value through intent you check whether you should show the button based on that value or hide it...here is an example: Let's say you want to show a button only when the user clicks on Brazil country, here how to do it:
      - MainActivity will have this intent:
      Intent mIntent = new Intent(MainActivity.this, NewActivity.class);
      mIntent.putExtra("countryName", "Brazil");
      mIntent.startActivity(mIntent)
      - NewActivity will receive the value from MainActivity and you check if the item listview that was clicked is Brazil, then you show the buttons, otherwise hide it:
      Bundle mBundle = getIntent().getExtras();
      if(mBundle != null){
      String country = mBundle.getString("countryName");
      if(country.equalIgnoreCase("Brazil"){
      button.setVisibility(View.VISIBLE);
      }else{
      button.setVisibility(View.GONE);
      }
      }
      I hope that helps :)

  • @moremansi81
    @moremansi81 4 ปีที่แล้ว

    Thank you sir 😊

  • @NanaOssgh
    @NanaOssgh 7 ปีที่แล้ว

    Hello is there a way to add a search function to the project so that I can search for a country and still click and view the flag or the detail, please kindly help with that.

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, i'm sorry i don't have a tutorial that covers search function, here a tutorial that may guide you on that: coderwall.com/p/zpwrsg/add-search-function-to-list-view-in-android

  • @ayoubcheikh4554
    @ayoubcheikh4554 6 ปีที่แล้ว

    i need add text In place the image
    What should he do?

  • @purvigajjar7674
    @purvigajjar7674 6 ปีที่แล้ว

    hey, what to do if I want to add some description with the image in second activity?

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว +1

      Hi, add a textview inside activity_second.xml and SecondActivity.java file, then you can pass some data along with the image flag through Intent from MainActivity.java file.

  • @hamzanasirr
    @hamzanasirr 7 ปีที่แล้ว

    What command do you use to add the declaration for the app in XML?

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      It's Option + Return button on Mac

  • @rawezhful
    @rawezhful 5 ปีที่แล้ว

    Nice tutorial, thanks for your video, after clicking on any country and showing the country flag and name, I want to swipe right and left to transfer between countries, can you help me please?

  • @AmrElwekeel
    @AmrElwekeel 6 ปีที่แล้ว

    good job keep you wonderful

  • @vidhisahni8449
    @vidhisahni8449 6 ปีที่แล้ว

    how can i do the same thing using recyclerview + cardview. Also the title of the toolbar comes from user input.

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Hi, I made a tutorial about recyclerview: th-cam.com/video/RIoyRhlo5Oo/w-d-xo.html

  • @AbhishekSingh-np9tt
    @AbhishekSingh-np9tt 6 ปีที่แล้ว

    In my application no error but when I click to any activity application will stop

  • @youssefyasser2347
    @youssefyasser2347 5 ปีที่แล้ว

    hello,thank you so much sir but i get an error in the toolbar.setTitle it gives me a red line under setTitle what do i do?!

    • @CodingDemos
      @CodingDemos  5 ปีที่แล้ว

      Hi, may I know what is the error that you see under setTitle?

  • @qzzf1w
    @qzzf1w 5 ปีที่แล้ว

    great job!

  • @ermiyasabate7102
    @ermiyasabate7102 6 ปีที่แล้ว

    Tnx very much Coding Demos!!!!!!!!!!!! I have one question I want to use text View instead of image View? pls help me!!!

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Your welcome :D
      Just replace the imageview code with a textview code like this:

  • @ultimat.
    @ultimat. 4 ปีที่แล้ว

    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.

  • @newmoviesandsongs4834
    @newmoviesandsongs4834 7 ปีที่แล้ว

    Sir can you make a same task on fragment

  • @МуслимХасан-б3т
    @МуслимХасан-б3т 7 ปีที่แล้ว

    How to save imageView state in MainActivity?

  • @sankalpbhagat1692
    @sankalpbhagat1692 6 ปีที่แล้ว

    Hey, I have to show scroll view instead of flags. How to do it ??

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Hi, just remove ImageView xml and java code and add a ScrollView. I made a tutorial that will show you how to add a ScrollView: th-cam.com/video/Wx1wnv4fzyQ/w-d-xo.html

  • @juang9631
    @juang9631 5 ปีที่แล้ว

    Como tengas muchas banderas te vas a quedar sin if , sacalas por posicion dentro del array

  • @learnerszone16
    @learnerszone16 7 ปีที่แล้ว +1

    How to add individual text for every list item instead of image. please help...

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Ok here is how you can do it:
      - Replace the imageview with a textview in activity_second.xml file
      - Declare the textview in SecondActivity.java
      - If you have the text for each item in the list stored in Strings.xml file, make sure the text is not long and give it a name that is related to the item in the list.
      For example: If the user tap on Australia and you want to show the population, then create a string name that is related to Australia so that you easily reference it like this:
      24M
      - Once you have declared the textview in SecondActivity.java, you will replace the part where i set the correct image in the If-condition with the textview and it's value from the strings.xml like this:
      if(mToolbar.getTitle.toString.equalIgnoreCase(“Australia”)){
      textview.setText(getString(R.string.australia_population));
      }
      I hope that helps :)

    • @learnerszone16
      @learnerszone16 7 ปีที่แล้ว +1

      Thanks for your help brother. Your tutorials are very helpful.

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Your welcome :)

    • @supreethd9970
      @supreethd9970 6 ปีที่แล้ว

      +Coding Demos how to use web view instead of text view

  • @fufufufu3828
    @fufufufu3828 7 ปีที่แล้ว

    how to add text on every country? like a description for every country?

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, if it's a small description you may add them in the strings.xml file, but if you plan on adding very long text, it's better if you store in a database so that it will be easier to maintain in the future

  • @muhammadsaleh816
    @muhammadsaleh816 6 ปีที่แล้ว

    i have a problem
    unfortunately app has been stopped :(
    in logcat i checked it the problem is toolbar class not import i tried everything plz give me a solid solution

    • @charlese40187
      @charlese40187 6 ปีที่แล้ว

      You use android.support.v7.widget.Toolbar in your XML, but in your java code you are importing android.widget.Toolbar which is a different type. Change your import to android.support.v7.widget.Toolbar and it should work.
      Inside onCreate()
      Toolbar toolbar = (Toolbar)findViewById(R.id.toolbar);
      setSupportActionBar(toolbar); **

  • @ManojKumar-hp6si
    @ManojKumar-hp6si 6 ปีที่แล้ว

    Instead of image drawable ...for text textfield which method can be used...?

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Hi, if you want to show text you would use TextView.

    • @ManojKumar-hp6si
      @ManojKumar-hp6si 6 ปีที่แล้ว

      Flag.setTextView(Context Compact().GetTextView(SecindActivity.this,R.id.text1);
      Like the above code sir..?.by giving specific id to certain text view as needed..?pleaseeee reply sir..

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      You would set a text to a TextView like this: text.setText("This is a sample text");

  • @دانية-د1س
    @دانية-د1س 7 ปีที่แล้ว

    Thank you for the wonderful video .. I design a draft list of pictures displayed books and when clicking on the pictures show me books that are in html format Can anyone help me, ?or give me a video that benefits me

  • @duniatv4432
    @duniatv4432 7 ปีที่แล้ว +1

    how to add image from that list view created

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      You can add the image inside the drawable folder in your project

  • @deepaksinghmudila614
    @deepaksinghmudila614 5 ปีที่แล้ว

    thanku

  • @help4youtube748
    @help4youtube748 7 ปีที่แล้ว

    Hi sir .. thanks so much for this amazing Example ... Can you help me please .. i want to add detail about the cauntry from assets (file.txt) ..waiting for your replay sir and thank you again for this tutorial

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, i'm sorry i'm not really familiar with reading data from assets folder.
      Thanks for watching :)

  • @shiishinsakaue3380
    @shiishinsakaue3380 7 ปีที่แล้ว

    Hi im implementing searchview with listview. so i want to intent all the item that i put in listview in another activity. please help me howww. badly needed

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, by intent you mean you want the user who clicks on the items inside that listview will go to another activity?

    • @shiishinsakaue3380
      @shiishinsakaue3380 7 ปีที่แล้ว

      +Coding Demos yes. when i search the item. then click it i want it to be intent in the other activity

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      You can call listview.setOnItemClickListener and inside the onClick method you set which activity you want to start inside the Intent

    • @shiishinsakaue3380
      @shiishinsakaue3380 7 ปีที่แล้ว

      +Coding Demos i did. But when i search it randomly, it goes in order because of position

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hmm..Can you please email me the code (codingdemos@gmail.com) and i'll see what i can do :)

  • @prathameshshinde6255
    @prathameshshinde6255 6 ปีที่แล้ว

    WoW! Gr8 Video. Can you help me with custom grid adapter. Is similar thing possible with grid layout. For eg: if i want to develop a custom calendar with each date as image button and want to handle the click on all the dates and display something after the click as we did flags in above tutorial , is it possible? I don't want to use one activity per date because the app size will go he wire. Please help me with this because i think this is the best channel for android on you tube.

  • @王齡漢
    @王齡漢 8 ปีที่แล้ว

    How can I code main listview to another listview not for image?

    • @CodingDemos
      @CodingDemos  8 ปีที่แล้ว

      Hey thanks for watching, so you mean that when you click on item inside listview you want to go to a second screen that have a listview as well? if that's your question, then here is how to do it:
      - Remove the imageView code in SecondActivity.java and activity_second.xml and then you add a listview code exactly like we did for the MainActivity.java and activity_main.xml
      - You can change the values of listview items by opening strings.xml file and then you can create a string-array that will hold the values for the new listview
      - Open MainActivity.java and remove if-condition for checking the flag for the right country because you don't need that anymore
      - Inside listview onItemClick you write a normal intent without (PutExtras) as follows:
      Intent mIntent = new Intent(MainActivity.this, SecondActivity.class);
      startActivity(mIntent);
      I hope that helps :)

    • @王齡漢
      @王齡漢 8 ปีที่แล้ว +1

      thnaks so much!

  • @ja_simran_ja
    @ja_simran_ja 4 ปีที่แล้ว

    Are you still available to answer error questions ?

    • @ja_simran_ja
      @ja_simran_ja 4 ปีที่แล้ว

      Hiiii !!! Thank you so much for replying ! I was BADLY in need of it

    • @CodingDemos
      @CodingDemos  4 ปีที่แล้ว

      Yeah :)

    • @ja_simran_ja
      @ja_simran_ja 4 ปีที่แล้ว

      When I click on add toolbar , or Listview an error comes showing “Missing Contraints in ConstrainLayout”

    • @ja_simran_ja
      @ja_simran_ja 4 ปีที่แล้ว

      Please help, I’ve got a school submission due right tomorrow

    • @CodingDemos
      @CodingDemos  4 ปีที่แล้ว

      You are getting that issue because you are using constraint layout as the root layout for your xml file, and when you add views, you need to add some constraints on how you want to align them inside the screen. You can use other layouts like Linear layout or Relative layout as shown in the tutorial.

  • @Risky_nakul_dev
    @Risky_nakul_dev 6 ปีที่แล้ว

    thanks run without any error

  • @junggoo3534
    @junggoo3534 5 ปีที่แล้ว

    What if I want to setText instead of image???

    • @CodingDemos
      @CodingDemos  5 ปีที่แล้ว

      Hi, just replace the ImageView with TextView inside the layout file and make sure you reference that TextView inside Java file

  • @nareshgaur4961
    @nareshgaur4961 7 ปีที่แล้ว

    Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference...
    how to remove that error..sir..???

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      I need to see your code to be able to help you fix that issue, can you please email it to me: codingdemos@gmail.com

  • @mohsenrastegari7310
    @mohsenrastegari7310 7 ปีที่แล้ว

    hi ,thanks for this tutorial . English is not my native so it is difficult to understand

  • @adnanahmed6052
    @adnanahmed6052 6 ปีที่แล้ว

    I want search any country so what source code should i implement?
    Kindly help me!

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Hi, I made a video tutorial that will show you how to add a search function: th-cam.com/video/60_l4392dMc/w-d-xo.html

  • @dorganzo
    @dorganzo 3 ปีที่แล้ว

    Obrigado👍👍👍👍👍

  • @fidangill8781
    @fidangill8781 8 ปีที่แล้ว

    Thank you bro it was very useful. But how can I link 1 listview item with 2 activities?

    • @CodingDemos
      @CodingDemos  8 ปีที่แล้ว +1

      Hi Fidan i'm glad that you found it useful. now about your question: so what i understand from your question is you want to allow the user who clicks on the item inside the listview to be able to go to 2 separate activities right?

    • @fidangill8781
      @fidangill8781 8 ปีที่แล้ว +1

      Coding Demos yes. I am making an app which i a hymn book containing south asian christian hymns. I made a list view in an activity using your method and was able to link the list view items to one activity which is using images the way you have done. Some hymns have more than two pages of text(i've converted text into image to fit inside an image view). I really need help.

    • @CodingDemos
      @CodingDemos  8 ปีที่แล้ว

      i see now i got the idea, here is an example that might work for your case:
      - Inside listview onItemClick you can do an (if condition) like this:
      if(listview.getItemAtPosition(i).toString.equalIgnoreCase(“Hymn 1”)){
      startActivity(new Intent(MainActivity.this, Hymn1Activity.class));
      }else{
      startActivity(new Intent(MainActivity.this, Hymn2Activity.class));
      }
      What i did is when user clicks on item inside listview, i check if the clicked item equals to for example (Hymn1)? if it’s true then the user will go to the right screen, otherwise will go to a different screen
      if you need more clarification you can email me your code and i’ll do my best to help you out, you can find my email in the about section of the channel.
      Happy coding :)

  • @andredigital4472
    @andredigital4472 7 ปีที่แล้ว +1

    Hi, May I have the link of code sample? Thanks so much, Alessio

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, here is the link to the source code: github.com/codingdemos/CustomListview

  • @iadityagupta
    @iadityagupta 7 ปีที่แล้ว +1

    When I open the App It shows me "Unfourtunately App Running Stopped" Please Help me Out

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, can you please share with me the crash log from logcat

    • @12TE0463
      @12TE0463 7 ปีที่แล้ว +1

      The error is in the first comment

    • @NLYofficial
      @NLYofficial 7 ปีที่แล้ว

      How to fix it, sir?

    • @drusillagrace7883
      @drusillagrace7883 6 ปีที่แล้ว

      Check the API versions of the phone and emulator both should API should be same then it works

    • @azian0002
      @azian0002 6 ปีที่แล้ว +1

      Change in Main activity.java from import android.widget.Toolbar to import android.support.v7.widget.Toolbar;

  • @adnanahmed6052
    @adnanahmed6052 6 ปีที่แล้ว

    I applied your source code but
    Following error message shows.
    "Unfortunately app stops "

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Hi, did you get any error messages in the logcat when the app stopped?

  • @potatolaptop2814
    @potatolaptop2814 7 ปีที่แล้ว +1

    hello, i'm beginner ..how to add intent in every listview...?

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, i'm sorry could you please explain exactly what you want to do?

    • @potatolaptop2814
      @potatolaptop2814 7 ปีที่แล้ว +1

      When the item list is clicked... then to the new activity....
      like item menu then menu contents...

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว +1

      ahaa ok i understand, you can start a new activity inside onItemClickListener method, then inside there you write an intent like this:
      listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
      @Override
      public void onItemClick(AdapterView parent, View view, int position, long id) {
      Intent mIntent = new Intent(MainActivity.this, DetailActivity.class);
      startActivity(mIntent);
      }
      });
      Happy coding :)

    • @potatolaptop2814
      @potatolaptop2814 7 ปีที่แล้ว

      hehe still newbie, master.... maybe you can make video for this tutorial... :)

    • @mimrankhan9974
      @mimrankhan9974 7 ปีที่แล้ว

      Thanx man im also beginers and im also lookingfor this code thanx

  • @codepro1460
    @codepro1460 4 ปีที่แล้ว

    Hello, how to change size item in list view please i need solution

    • @CodingDemos
      @CodingDemos  4 ปีที่แล้ว +1

      Hi, you need to create a custom layout for the listview. From that layout, you can customize the appearance of the listview items

    • @codepro1460
      @codepro1460 4 ปีที่แล้ว

      @@CodingDemos Hi, how to make please Explain to me, please, or upload codes

    • @CodingDemos
      @CodingDemos  4 ปีที่แล้ว

      @@codepro1460 I've uploaded a tutorial a while back that shows you how to create a custom listview. Here is the link to the video: th-cam.com/video/q2XA0Pe2W04/w-d-xo.html

  • @lizziew267
    @lizziew267 5 ปีที่แล้ว

    I can’t even get as far as 2:00 in as I don’t have those options in my palette 😭 please explain how to add also my view isn’t in a device it’s just a rectangle

    • @CodingDemos
      @CodingDemos  5 ปีที่แล้ว

      Hi, may I know what exactly do you want to add from the palette? Android Studio have changed its UI since I recorded this tutorial

    • @sohailfarooqi3282
      @sohailfarooqi3282 5 ปีที่แล้ว

      @@CodingDemos Same for me at 2:00 you add custom view which is not available in my palette as well, i have an exam tomorrow kindly please help a brother out lol

  • @Manojkumar-gq5bd
    @Manojkumar-gq5bd 6 ปีที่แล้ว

    hello sir,how can use for TextView instead of ImageView ..pleasee help me sir.

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Hi, just replace the code for ImageView with TextView.
      Inside xml file you add this code for TextView:
      --------
      In java file you add this code:
      TextView text = findViewById(R.id. textView);
      I hope that helps :)

    • @Manojkumar-gq5bd
      @Manojkumar-gq5bd 6 ปีที่แล้ว

      Thank u sir,for replying....u r such a great person sir...thank u

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Your welcome and happy coding :D

    • @ManojKumar-hp6si
      @ManojKumar-hp6si 6 ปีที่แล้ว

      If(toolbar.get title().equalsIgnoreCase("Australia")){
      textview.setText("hello");
      }
      Its correct sir?? For text field instead of image view

    • @ManojKumar-hp6si
      @ManojKumar-hp6si 6 ปีที่แล้ว

      Pleaseeeeeee reply sirr

  • @caturrahmadani405
    @caturrahmadani405 7 ปีที่แล้ว

    How to set Text Size in ListView ??

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      You will need to create a custom xml layout that will have a textview, this textview will represent the text shown in the list, then you can customize the text size, font...etc

  • @NoNaMeEaSy
    @NoNaMeEaSy 4 ปีที่แล้ว

    Cool

  • @sharashchandraudupa5241
    @sharashchandraudupa5241 6 ปีที่แล้ว

    Sir, I am new to this ,can you please help me how can I implement list within a list
    For eg: when I open the app it will show a list
    Like Nokia,Sony,Apple.... then when I click on the Nokia it will show a new list (eg:6,5,3)
    Finally when I click on that I should get the details about the selected items can you please tell me how can I implement??

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Hi, so in the final step you will get the selected items from both listviews right? Here is my email (codingdemos@gmail.com) for you to share more details.

    • @sharashchandraudupa5241
      @sharashchandraudupa5241 6 ปีที่แล้ว

      Coding Demos hi sir, I mailed you about the problem .Sorry for the late reply . Thankyou

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว +1

      Hi, I've received your email :)

  • @berdibekkazigulov9700
    @berdibekkazigulov9700 6 ปีที่แล้ว

    Respect!

  • @ajmenorca5324
    @ajmenorca5324 6 ปีที่แล้ว

    is it possble to add searchbar is this?

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Hi, I did a video tutorial that will show you how to do it: th-cam.com/video/60_l4392dMc/w-d-xo.html

    • @ajmenorca5324
      @ajmenorca5324 6 ปีที่แล้ว

      thanks mate i really appreciate it

    • @CodingDemos
      @CodingDemos  6 ปีที่แล้ว

      Your welcome :D

  • @vinso6600
    @vinso6600 7 ปีที่แล้ว +1

    hi, could you please paste the code here? English is not my native so it is difficult to understand technical language in English :)

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, here is the link to the source code: github.com/codingdemos/CustomListview

    • @vinso6600
      @vinso6600 7 ปีที่แล้ว

      Coding Demos, thanks! I have one more question how to change size of the letters?

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว +1

      You will need to create a custom layout for the item inside the list, once you do that you will be able to customize the text in terms of size, color or even if you want to add an image next to the text. You can refer to this video that i did which will show how to create custom listview th-cam.com/video/q2XA0Pe2W04/w-d-xo.html

    • @vinso6600
      @vinso6600 7 ปีที่แล้ว +1

      Coding Demos thanks!

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว +1

      Your welcome, happy coding :)

  • @nareshgaur4961
    @nareshgaur4961 7 ปีที่แล้ว

    how to add the detail about the country ..???pls rply

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Hi, i'm sorry i didn't fully understand your question, can you please explain in detail :)

    • @nareshgaur4961
      @nareshgaur4961 7 ปีที่แล้ว +1

      i mean when i click on listview it show the detail about the country with country flag.. :)

    • @CodingDemos
      @CodingDemos  7 ปีที่แล้ว

      Ahaa ok i got...let's say we want to add country population, here is how to do it:
      - In activity_second.xml file where we've added the imageview for country flag, we will add a textview that will hold the country population
      - Inside SecondActivity.java file we will define the textview like this:
      TextView mPopulation = (TextView)findViewById(R.id.tvPopulation);
      - Inside the if-condition where we check for the country name and its flag we will set population value like this:
      if (mToolbar.getTitle().toString().equalsIgnoreCase("Australia")) { flag.setImageDrawable(ContextCompat.getDrawable(SecondActivity.this, R.drawable.flag_australia));
      mPopulation.setText("23.13 million");
      }
      If you still need some help you can email me your code and i'll do my best to help you out.
      Happy coding :)

    • @nareshgaur4961
      @nareshgaur4961 7 ปีที่แล้ว

      thanks for help.. :-)