【异常解决】android.content.ActivityNotFoundException: Unable to find explicit activity class
2013-07-08 17:16
645 查看
异常:
01-01 16:19:13.269: E/AndroidRuntime(2969): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.x210.communication/com.x210.communication.SubActivity};have you declared this activity in your AndroidManifest.xml?
问题呈现:
问题解决:
其实可以根据错误提示:have you declared this activity in your AndroidManifest.xml? 知道错误根源是在清单文件中没有注册Activity;
在AndroidManifest.xml的<application></application>节点中添加如下注册代码即可:
01-01 16:19:13.269: E/AndroidRuntime(2969): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.x210.communication/com.x210.communication.SubActivity};have you declared this activity in your AndroidManifest.xml?
问题呈现:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); textView = (TextView) findViewById(R.id.textShow); final Button btn1 = (Button) findViewById(R.id.btn1); btn1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent intent = new Intent(ActivityCommunication.this, SubActivity.class); startActivity(intent);//从当前Activity跳转到SubActivity } }); }AndroidManifest.xml
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name" > <activity android:label="@string/app_name" android:name=".ActivityCommunication" > <intent-filter > <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application>
问题解决:
其实可以根据错误提示:have you declared this activity in your AndroidManifest.xml? 知道错误根源是在清单文件中没有注册Activity;
在AndroidManifest.xml的<application></application>节点中添加如下注册代码即可:
<activity android:name =".SubActivity"/>
相关文章推荐
- android.content.ActivityNotFoundException: Unable to find explicit activity class解决办法
- android.content.ActivityNotFoundException: Unable to find explicit activity class
- android.content.ActivityNotFoundException: Unable to find explicit activity class {...}; have you de
- android.content.ActivityNotFoundException: Unable to find explicit activity class错误原因排查
- android.content.ActivityNotFoundException: Unable to find explicit activity class {...}; have you declared this activity in your AndroidManifest.xml?
- 【Android 疑难杂症1】android.content.ActivityNotFoundException: Unable to find explicit activity class
- Caused by: android.content.ActivityNotFoundException: Unable to find explicit activity class
- android.content.ActivityNotFoundException: Unable to find explicit activity class have you declared this activity in your AndroidManifest.xml?
- android.content.ActivityNotFoundException: Unable to find explicit activity class 【安卓报错】
- Android开发问题:ActivityNotFoundException: Unable to find explicit activity class
- Android开发问题:ActivityNotFoundException: Unable to find explicit activity class
- android.content.ActivityNotFoundException: Unable to find explicit activity
- Android开发Exception:ActivityNotFoundException: Unable to find explicit activity class
- Android开展Exception:ActivityNotFoundException: Unable to find explicit activity class
- Android开发问题:ActivityNotFoundException: Unable to find explicit activity class
- ActivityNotFoundException: Unable to find explicit activity class
- Android 异常解决 content.ActivityNotFoundException: Unable to find explicit activity class
- Android问题解决记录—android.content.res.Resources$NotFoundException: Unable to find resource ID
- android.content.res.Resources$NotFoundException: Unable to find resource ID 0#0xffffffff
- 【异常解决】android.content.ActivityNotFoundException