AndroidManifest.xml中的活动声明 [英] Activity Declaration in AndroidManifest.xml
问题描述
我的股票报价应用程序出现运行时错误.我有一个应用程序,您可以在其中输入股票代码(如在股市中),并用两个按钮将其列出.一个按钮显示报价,另一个按钮查看网络上的更多信息.网络功能很好,但是当我点击报价按钮时,应用程序崩溃了.
I have a runtime error on my stock quoting application. I have an app where you input your a stock (as in stock market) code and will list it with two buttons. One button to display a quote and the other to view more info from the web. The web function is fine but the app crashes when I hit the quote button.
LogCat问我是否在AndroidManifest.xml
中声明了我的活动.我还是Android开发的新手,所以这是我能分析问题的最佳方法.我不确定在哪里可以找到这些错误.
LogCat is asking me whether I declared my activity in my AndroidManifest.xml
. I am still new to Android development so this is the best of which I can analyze the problem. I am not sure where to look for these errors.
如果您需要测试修复程序,只需使用"mstf"作为股票代码.
Just use 'mstf' as a stock code if you need to test a fix.
您可以在这里找到我的应用程序:https://github.com/xamroc/StockQuote/tree/bug-quote
You can find my app here: https://github.com/xamroc/StockQuote/tree/bug-quote
我还要感谢有关Android调试工具或技术的所有提示.
I would also appreciate any tips on debugging tools or techniques for Android.
推荐答案
您的程序包中有两个活动,但是在清单中仅声明了一个.
You have two activities in your package, but have only declared one in manifest.
声明另一个Activity类:
Declare the other Activity class:
将此添加到您的清单:
<activity
android:name="com.example.stockquote.StockInfoActivity"
android:label="@string/app_name" />
这篇关于AndroidManifest.xml中的活动声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!