在申请初始化之前,我的应用程序是否会卡住我的应用?

发布于 2025-01-19 12:40:44 字数 347 浏览 0 评论 0原文

我正在使用JetPack组成。当我打开应用程序时,它会在我的第一个活动出现之前显示一个带有原色状态栏的空白页,由于某些原因,我无法在此处张贴代码片段,请在下面查看屏幕截图:

i在stactbasecontext()中都有logs和我的应用程序的oncreate。

​当“混淆”页面显示时,LogCat中的第一个活动(请参阅第二个屏幕截图)。这是怎么发生的?我可以以某种方式解决这个问题吗?

顺便说一句,我还使用刀柄作为我项目的注射。

I am using Jetpack Compose. When I open my app, it displays a blank page with a status bar in primary color before my first activity shows up, for some reasons I can't post code snippets here please check screenshots below:

I have logs in attachBaseContext() and onCreate of my Application.

I have log in onCreate() of my unique Activity.

My first activity displays all the contents correctly, but as you can see that no log prints out from either Application or my first Activity in Logcat when the confused page shows up(See the 2nd screenshot). How did this happen? Can I somehow fix this issue?

BTW I am also using Hilt as injection in my project.

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

夜空下最亮的亮点 2025-01-26 12:40:44

从头开始启动JetPack组成项目的最佳方法是使用File≫ New Project的空撰写项目。它将用所有必要的依赖项和最小的工作屏幕以及主题您的项目所需的所有内容准备一个基本项目。

几乎没有建议解决您的问题:

  • 尝试使用log类以在logcat中显示日志:

log.d(“ tag”,“ message”)

  • 从我们可以看到的您的显示应显示uipage(),但是此方法仅定义为原型,但没有内容。尝试使用:
@Composable
fun UiPage(){
Text("MyPage")
}

一般而言,当您编写帖子时,使用特定格式更有效(可读)发布代码片段。使用屏幕截图仅显示图形。

The best way to start a Jetpack Compose project from scratch is using an Empty Compose Project from File>New Project. It will prepare a basic project with all the necessary dependencies and a minimal working screen, plus all what is needed to theme your project.

Few suggestions to address your issue:

  • try to use Log class to show logs in the Logcat:

Log.d("TAG","Message")

  • From what we can see your display should show UiPage(), but this method is only defined as a prototype but has no content. Try using:
@Composable
fun UiPage(){
Text("MyPage")
}

In general, when you write a post is more efficient (and readable) post your code snippets using specific formatting. Use screenshots just to display graphics.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文