ActivityNotFoundException:无法找到明确的活动类 [英] ActivityNotFoundException: Unable to find explicit activity class
问题描述
我想从我的主要活动开始活动。它没有工作,我发疯。我拥有的是:
I am trying to start an activity from my main activity. Its not working and driving me nuts. What I have is:
Intent i = new Intent ("net.xxx.View1");
Context con = this.getBaseContext();
ComponentName cn = new ComponentName("net.xxx.Mybooks", "BookView");
i.setComponent(cn);
Bundle extras = new Bundle();
ooo
i.putExtras(extras);
startActivity(i);
Manifest is:
android:name="BookView" >
<intent-filter >
<action android:name ="android.intent.action.VIEW" />
<action android:name ="net.xxx.View1" />
<category android:name ="android.intent.category.DEFAULT" />
</intent-filter>
我得到的是:
* 02-03 19:34:47.448:E / AndroidRuntime(2027):android.content.ActivityNotFoundException:无法找到明确的活动类{net.xxx.Mybooks /图书查看};有你在你的AndroidManifest.xml宣布这项活动* 的
这将是正确的,我想,如果'/'是'。
What I get is:
*02-03 19:34:47.448: E/AndroidRuntime(2027): android.content.ActivityNotFoundException: Unable to find explicit activity class {net.xxx.Mybooks/BookView}; have you declared this activity in your AndroidManifest.xml *
Which would be correct, I think, if the '/' was a '.'
我试图与上下文和没有任何componetName,结果始终是相同的。
I tried with context and without any componetName, the result is always the same.
SdkVersion =10
在此先感谢您的帮助
崖
SdkVersion="10"
Thanks in advance for your help
Cliff
推荐答案
好,尽管没有找到活动的蛤蜊,问题是在新的活动。它有一个空指针异常,在code。所以,我花了一天左右的追逐错误的问题。
Well despite the clams of activity not found, the problem was in the new activity. It had a null pointer exception in the code. So I spent a day or so chasing the wrong problem.
感谢您的时间反正
崖
这篇关于ActivityNotFoundException:无法找到明确的活动类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!