我是Android开发人员的新手,我已经经历了类似的主题,但还没有帮助。 我创建了一个应用程序,它在我添加扫描QR码的功能之前就已经运行了。它可以在模拟器上运行但是当我在我的三星设备上运行时,它会启动到白色屏幕,这就是我的日志所说的:
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.
答案 0 :(得分:0)
这是由于冷启动问题。参考https://developer.android.com/topic/performance/launch-time.html
如果在启动时执行大量初始化,可能会发生这种情况。
答案 1 :(得分:0)
将此添加到
中的AndroidManifest.xml<application>
android:allowBackup="true"
android:hardwareAccelerated="false"
android:largeHeap="true"
</application>