How can i detect the button setOnClickListener in info window on google map? Actually in my info window i have a button and i want to click on that button. Is this possible to do this?
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Actually it not posiable, Google Map renders the content of you custom
InfoWindow
into an image and displays it to you as an Image. Therefore you set a click Listener only to the whole window and not to the Views inside it.Your only choice it to set the
ClickListener
to the wholeInfoWindow
and popup an Dialog with clickable content you want, and not do it directly inside theInfoWindow
.From
Google Docs
: https://developers.google.com/maps/documentation/android/marker#info_windowsWe actually tried to address this issue by developing a library the can ease the creation of live(interactive) info windows.
https://github.com/Appolica/InteractiveInfoWindowAndroid
I know it is an old question but I hope it can help someone in the future.
You can basically add your own fragment as an info window using the manager provided by our library. The following is a snipped of how easily the library can be used. Check the link above for more information
Try this create own class as
Use it in your activity:
Try it