Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • 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 MapActivityMost of the code are just silly permissions)



This is ToursFragmentThe main idea is when user clicks on listview item to open a google map with that location, nothing more)
 
Rancher
Posts: 2862
32
  • Mark post as helpful
  • send pies
  • 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
  • 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: 2862
32
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • 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: 2862
32
  • Mark post as helpful
  • send pies
  • 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
  • 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: 2862
32
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Ok, I will. Thank you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!