Android 异常解决 content.ActivityNotFoundException: Unable to find explicit activity class
来源:互联网 发布:php防止sql注入代码 编辑:程序博客网 时间:2024/04/25 21:01
出错提示:
android.content.ActivityNotFoundException: Unable to find explicit activity class
1. 刚开始发现这个问题,觉得是代码有问题,但实际上并不是。
CODE snipet
@Override public void onClick(View v) { Intent intent = CrimeActivity.newIntent(getActivity(), mCrime.getId()); startActivity(intent); }
2. Solution
依据提示”have you declared this activity in your AndroidManifest.xml?”,可以明白大概方向,google一处1,基本上就知道在AndroidManifest.xml中少了部分,只是我不太明白为什么非要在这里注册呢?
<?xml version="1.0" encoding="utf-8"?><manifest package="com.york.android.criminalintent" xmlns:android="http://schemas.android.com/apk/res/android"> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".CrimeActivity"></activity> <activity android:name=".CrimeListActivity"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter> </activity> </application></manifest>
后记
From this code, I learned lately that this code let the OS can start it.
…to the manifest so that the OS can start it.
0 0
- 【异常解决】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 【安卓报错】
- 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
- android.content.ActivityNotFoundException: Unable to find explicit activity class解决办法
- android.content.ActivityNotFoundException: Unable to find explicit activity
- Caused by: 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错误原因排查
- ActivityNotFoundException: Unable to find explicit activity class
- Android开发问题:ActivityNotFoundException: Unable to find explicit activity class
- Android开发Exception:ActivityNotFoundException: Unable to find explicit activity class
- Android错误:unable to find explicit activity class
- Unable to find explicit activity class
- Unable to find explicit activity class
- Unable to find explicit activity class
- 2946: [Poi2000]公共串 二分+hash
- find、grep、wc使用方法简单总结
- hdu 2842 Chinese Rings(矩阵递推)
- VS2012 scanf()运行通不过的时候,提示需要使用scanf_s()的解决办法。
- 线程池与cp命令的实现
- Android 异常解决 content.ActivityNotFoundException: Unable to find explicit activity class
- Unity Notes之协程(Coroutine)简析
- 【LeetCode OJ 242】Valid Anagram
- 路漫漫其修远兮吾将上下而求索
- Vijos P1097 合并果子(优先队列 贪心)
- MFC打开文件对话框
- 【Android源码-PMS】(二)ComponentInfo类
- Python进程和线程
- C语言中各种数据类型的大小