Android Hello World 在首次启动后停止工作
我试图让 Google 的 Android Hello World 应用程序在 Eclipse 中运行。第一次 AVD 确实显示“Hello World”,但是当我单击它并从 Eclipse 重新启动应用程序时,没有任何反应 - 无论我等待多久。
杀死进程列表中的 adb.exe 没有帮助。
实际上,在启动 AVD 本身时,我看到了堆栈跟踪。不幸的是,启动 AVD 显然需要 3 个命令提示符,在您可以读取输出内容之前,这些提示符都会消失。
I trying to get Google's Hello World app for Android working in Eclipse. The first time the AVD indeed displays "Hello World", but when I click it away and restart the application from Eclipse, nothing happens - however long I wait.
Killing adb.exe in the process list does not help.
I actually see a stacktrace when just launching the AVD itself. Unfortunately, launching an AVD apparently takes 3 command prompts which all disappear before you can read what is outut to them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您遇到的问题是应用程序只是从停止的地方开始,因为应用程序没有更改。
如果更改代码,请保存它(如果需要,请再次将其还原,然后保存),然后尝试再次从 Eclipse 运行应用程序。
这样做的原因是,Eclipse 仅在代码更改时才将新的 APK 安装到模拟器中,以节省时间。如果未安装新的 APK,通常原始应用程序只会将其自身带到前台。
如果您不想更改代码,另一种方法是访问 DDMS(窗口 -> 打开透视图 -> DDMS)并在左侧打开模拟器实例,选择应用程序的名称(由包指定) name)并单击红色停止按钮来终止该进程。这样,您的应用程序应该正常启动,而无需恢复到其备用实例。
如果您遇到 Logcat 问题,对于某些人来说,在命令行中运行此命令会有所帮助:
I think the problem you are having, is that the application is just starting off from where it left off, because the application hasn't changed.
If you change the code, save it (, revert it back again if you want, save it), then try running the application from Eclipse again.
The reason for this is that Eclipse will only install the new APK to the emulator when the code has changed, to save time. If the new APK isn't installed, then typically the original application will just bring itself to the foreground.
If you don't want to change the code, an alternative is to access the DDMS (Window->Open Perspective->DDMS) and open your emulator instance on the left side, choose the name of your application (designated by package name) and click on the red stop button to kill the process. This way, your application should start up as normal, without reverting to its standby instance.
If you are having Logcat issues, for some people running this in the command line helps: