Navigation with Waze and Google Maps using Intent.createChooser shows Waze icon twice

前端 未结 1 614
梦谈多话
梦谈多话 2021-01-18 07:57

I\'m creating this question after finding the answer, I was not sure about the etiquette, but it seems to be OK (plus, I see now there\'s a built-in option).

The pro

相关标签:
1条回答
  • 2021-01-18 08:46

    After some time I used the solution found here, and there was only one icon that was working properly. As I wrote in the question, I could not use this solution because it lacks the flexibility I needed, so after looking at the code I saw that what was missing was this:

    intentWaze.setPackage("com.waze");
    // and more importantly, this:
    intentGoogleNav.setPackage("com.google.android.apps.maps");
    

    It seems that Waze is listening to the Google Maps intent (and does not work well with it), and that's why there were two icons.

    0 讨论(0)
提交回复
热议问题