• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to set listview clickable in order to open a map?

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, guys and girls, Thomas again. I have one more problem with my app. It includes Google maps.Question is similar to my previous question with Youtube. Also don't know how to open a map with a click on listview item. I have a list of Tours in a Fragment, I retrieved the list from Firebase and all, I even add coordinates of each tour on Firebase, but probably something is missing in my code. Can someone help me with this problem. Thank you all in advance. This is my code:

This is MapActivity:(Most of the code are just silly permissions)



This is ToursFragment:(The main idea is when user clicks on listview item to open a google map with that location, nothing more)
 
Rancher
Posts: 4739
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

similar to my previous question with Youtube.


How did you solve that problem?  It seems to be a very similar problem.
 
Thomas Lance
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's the thing. I didn't solve it, if I were, I wouldn't ask similar question.
 
Norm Radder
Rancher
Posts: 4739
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are lots of code examples online when searching for: clickable listview android tutorial
For example:  https://stackoverflow.com/questions/13281197/android-how-to-create-clickable-listview

Where does your code set the listener by calling the setOnItemClickListener method?
 
Thomas Lance
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At the end of the code..onItemClick method...but I did something wrong cause it's not working , that's why I'm asking for help.
 
Norm Radder
Rancher
Posts: 4739
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I do not see where the code is calling the setOnItemClickListener method.  When I do a search for "setOnItemClickListener" I do not see it.

What line of code calls that method?
 
Thomas Lance
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I didn't used OnItemClickListener...cause I'm working with Butterknife, which you can see at the of the code. But, by all means, help me in anyway you can..If you want to use that method, that's ok...as long as it works. Thanks.
 
Norm Radder
Rancher
Posts: 4739
38
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry, I know nothing about  Butterknife.  

Try using the setListener method as shown in the link I posted.
 
Thomas Lance
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok, I will. Thank you.
 
You can thank my dental hygienist for my untimely aliveness. So tiny:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic