AndroidManifest.xml 中的活动声明 [英] Activity Declaration in AndroidManifest.xml

查看:44
本文介绍了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆