繁体   English   中英

Android应用启动至设备上的白屏

[英]Android app launches to white screen on device

我是Android开发人员的新手,我已经经历过类似的话题,但还没有帮助。 我创建了一个应用程序,该应用程序在添加扫描二维码的功能之前正在运行。 它可以在模拟器上运行,但是当我在三星设备上运行它时,它将启动到白屏,这就是我的日志所说的:

Launching app
No apk changes detected since last installation, skipping installation of .....
$ adb shell am force-stop com.KtvrBusSerice.KtvrBusService.KtvrBusService
$ adb shell am start -n "com.KtvrBusSerice.KtvrBusService.KtvrBusService/com.KtvrBusSerice.KtvrBusService.KtvrBusService.LoginActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Client not ready yet..Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Waiting for process to come online
Connected to process 22097 on device samsung-sm_g930f-0123456789ABCDEF
D/jdwp: sendBufferedRequest : len=0x79
Application terminated.

这是由于冷启动问题。 请参阅https://developer.android.com/topic/performance/launch-time.html
如果在启动时执行大量初始化,则可能会发生这种情况。

将此添加到您的AndroidManifest.xml

<application>
    android:allowBackup="true"
    android:hardwareAccelerated="false"
    android:largeHeap="true"
</application>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM