在申请初始化之前,我的应用程序是否会卡住我的应用?
我正在使用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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从头开始启动JetPack组成项目的最佳方法是使用File≫ New Project的
空撰写项目
。它将用所有必要的依赖项和最小的工作屏幕以及主题您的项目所需的所有内容准备一个基本项目。几乎没有建议解决您的问题:
log
类以在logcat中显示日志:log.d(“ tag”,“ message”)
uipage()
,但是此方法仅定义为原型,但没有内容。尝试使用:一般而言,当您编写帖子时,使用特定格式更有效(可读)发布代码片段。使用屏幕截图仅显示图形。
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:
Log
class to show logs in the Logcat:Log.d("TAG","Message")
UiPage()
, but this method is only defined as a prototype but has no content. Try using: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.