Create a map activity inside android notification

2019-02-25 14:49发布

I want to show a live map inside an andriod notification. Is it possible to create a google map activity inside an android notification and pass it long lat values to show the location of a restaurant/location and an eta from that point ?

1条回答
啃猪蹄的小仙女
2楼-- · 2019-02-25 15:34

No, that is not possible, assuming that by "live map" you mean Maps V2's MapView. The RemoteViews that you can use in a Notification can only handle a few widgets, and MapView is not one of them.

You are welcome to use some sort of static map image generator and show that image in an ImageView in the Notification.

Note that even an expanded Notification is not all that large, so your map will be rather small.

查看更多
登录 后发表回答