浮动动作按钮问题

发布于 2025-02-10 05:42:50 字数 713 浏览 1 评论 0原文

我正在尝试在我的应用程序中启动另一个活动。它将打开地图API。 我是新来的,不断收到错误或我的应用程序崩溃。

<com.google.android.material.floatingactionbutton.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_marginEnd="16dp"
    android:layout_marginBottom="16dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:srcCompat="@drawable/ic_launcher_foreground"
    android:contentDescription="@string/title_activity_maps"
    android:contextClickable="true"
    android:onClick="activity_maps"/>

而且我似乎也无法弄清楚如何使地图活动打开地图。它显示了底角的Google图标,但这就是我所得到的。

谢谢!

I'm trying to make a FAB launch another activity in my Application. It'll open the Maps API.
I'm new at this an keep getting errors or my app crashes.

<com.google.android.material.floatingactionbutton.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom|end"
    android:layout_marginEnd="16dp"
    android:layout_marginBottom="16dp"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:srcCompat="@drawable/ic_launcher_foreground"
    android:contentDescription="@string/title_activity_maps"
    android:contextClickable="true"
    android:onClick="activity_maps"/>

And I also can't seem to figure out how to make the Maps activity open the map. It shows the Google Icon in the bottom corner but that's all I get.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文