gpt4 book ai didi

android - 如何使用 Activity 框打开完整操作

转载 作者:行者123 更新时间:2023-11-30 02:16:06 24 4
gpt4 key购买 nike

我试图通过应用程序选择找到有关 Android 窗口的一些信息,但找不到任何信息。我一直在寻找对话框,我们可以在其中单击“只打开一次”或“始终使用它”。

link to the image

如何调用?我必须自己编写代码还是构建?

最佳答案

这被称为将用户发送到 android 中的另一个应用程序。您需要编写代码,当用户单击特定事物链接电话号码或 IP 地址时,应在何时以及在哪个应用程序中打印。

send the user to another app based on an "action" it would like to perform. For example, if your app has the address of a business that you'd like to show on a map, you don't have to build an activity in your app that shows a map. Instead, you can create a request to view the address using an Intent. The Android system then starts an app that's able to show the address on a map. From Android official site.

您也可以对其进行编码以自动执行操作。

要打开网页,您可以像这样编写代码。

Uri webpage = Uri.parse("http://www.android.com");
Intent webIntent = new Intent(Intent.ACTION_VIEW, webpage);

一旦你创建了你的 Intent 就开始吧

startActivity(intent);

它会为您打开那个盒子。 Box you wanted

有关如何执行此操作的完整说明,请阅读这些 android 官方文档。

http://developer.android.com/training/basics/intents/sending.html

关于android - 如何使用 Activity 框打开完整操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29315087/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com