gpt4 book ai didi

Android Studio Kotlin 如何打印字符串以及它们出现在哪里

转载 作者:行者123 更新时间:2023-12-02 19:55:13 29 4
gpt4 key购买 nike

我之前确实看到过关于“如何打印到控制台”的问题...我来自 iOS/Xcode,那里有一个地方显示所有输出和错误,所以在 android studio 中如何显示有点令人困惑是多个输出的多个位置。

print("HELLO TRYING TO PRINT")
Log.d("PRINT", "Printing this message")

我已经尝试过这些,即使在“控制台”中并将其切换到“调试”并尝试搜索“打印”或“打印此消息”,它也没有出现。我正在使用三星 Note 8 来运行此应用程序。我尝试查找有关此问题的基本教程进行解释,但尚未找到任何教程。我只是想使用 print 语句来查看函数是否被调用。

最佳答案

In Android Studio choose Logcat at the bottom . Then from drop-downmenu select kind of logs that you want to view.
TAG is your identifier which is given by you.

  • Log.e(TAG, 字符串)(错误)
  • Log.w(TAG, String)(警告)
  • Log.i(TAG, String)(信息)
  • Log.d(TAG, String)(调试)
  • Log.v(TAG, 字符串)(详细)

然后在搜索栏搜索标签。

Go through this page

关于Android Studio Kotlin 如何打印字符串以及它们出现在哪里,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57212850/

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